[v3,2/6] mfd: cs42l43: Tidy up header includes
Commit Message
Use more forward declarations, move header guards to cover other
includes, and rely less on including headers through other headers.
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
Changes since v2:
- Added pm.h and regmap.h back into mfd/cs42l43.h
Thanks,
Charles
drivers/mfd/cs42l43-i2c.c | 6 +++++-
drivers/mfd/cs42l43-sdw.c | 6 +++++-
drivers/mfd/cs42l43.c | 8 +++++++-
drivers/mfd/cs42l43.h | 10 ++++++----
include/linux/mfd/cs42l43.h | 13 +++++++------
5 files changed, 30 insertions(+), 13 deletions(-)
Comments
On Thu, 25 Jan 2024, Charles Keepax wrote:
> Use more forward declarations, move header guards to cover other
> includes, and rely less on including headers through other headers.
>
> Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Patches look okay to me, but seeing as Andy suggested the changes, it
would be good to get a R-by from him.
> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
> ---
>
> Changes since v2:
> - Added pm.h and regmap.h back into mfd/cs42l43.h
>
> Thanks,
> Charles
>
> drivers/mfd/cs42l43-i2c.c | 6 +++++-
> drivers/mfd/cs42l43-sdw.c | 6 +++++-
> drivers/mfd/cs42l43.c | 8 +++++++-
> drivers/mfd/cs42l43.h | 10 ++++++----
> include/linux/mfd/cs42l43.h | 13 +++++++------
> 5 files changed, 30 insertions(+), 13 deletions(-)
On Thu, Jan 25, 2024 at 12:25 PM Charles Keepax
<ckeepax@opensource.cirrus.com> wrote:
>
> Use more forward declarations, move header guards to cover other
> includes, and rely less on including headers through other headers.
..
> Changes since v2:
> - Added pm.h and regmap.h back into mfd/cs42l43.h
Btw, TIL that your v1 was fully correct as there is no use of the type
definitions. In case you are going to send v3, you can use v1 of this
patch if you want, this version is also okay (as we have some more
like this pattern, which probably needs to be amended in the future).
On Thu, Jan 25, 2024 at 3:55 PM Lee Jones <lee@kernel.org> wrote:
> On Thu, 25 Jan 2024, Charles Keepax wrote:
>
> > Use more forward declarations, move header guards to cover other
> > includes, and rely less on including headers through other headers.
> >
> > Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
>
> Patches look okay to me, but seeing as Andy suggested the changes, it
> would be good to get a R-by from him.
I'm worried now only about missing a commit message in one patch and
(with less severity) the v2 of this one which appears not to be
necessary (i.e. v1 is fully okay). If you consider the commit message
absence is okay, feel free to apply v2, otherwise with that addressed
v3 can go in my opinion.
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
On Thu, 25 Jan 2024, Andy Shevchenko wrote:
> On Thu, Jan 25, 2024 at 3:55 PM Lee Jones <lee@kernel.org> wrote:
> > On Thu, 25 Jan 2024, Charles Keepax wrote:
> >
> > > Use more forward declarations, move header guards to cover other
> > > includes, and rely less on including headers through other headers.
> > >
> > > Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> >
> > Patches look okay to me, but seeing as Andy suggested the changes, it
> > would be good to get a R-by from him.
>
> I'm worried now only about missing a commit message in one patch and
> (with less severity) the v2 of this one which appears not to be
> necessary (i.e. v1 is fully okay). If you consider the commit message
> absence is okay, feel free to apply v2, otherwise with that addressed
> v3 can go in my opinion.
Please fix-up and submit a v4 with Andy's R-bs.
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
@@ -6,11 +6,15 @@
* Cirrus Logic International Semiconductor Ltd.
*/
+#include <linux/array_size.h>
#include <linux/err.h>
-#include <linux/errno.h>
#include <linux/i2c.h>
+#include <linux/mfd/cs42l43.h>
#include <linux/mfd/cs42l43-regs.h>
+#include <linux/mod_devicetable.h>
#include <linux/module.h>
+#include <linux/pm.h>
+#include <linux/regmap.h>
#include "cs42l43.h"
@@ -6,11 +6,15 @@
* Cirrus Logic International Semiconductor Ltd.
*/
+#include <linux/array_size.h>
#include <linux/device.h>
#include <linux/err.h>
-#include <linux/errno.h>
+#include <linux/mfd/cs42l43.h>
#include <linux/mfd/cs42l43-regs.h>
+#include <linux/mod_devicetable.h>
#include <linux/module.h>
+#include <linux/pm.h>
+#include <linux/regmap.h>
#include <linux/soundwire/sdw.h>
#include <linux/soundwire/sdw_registers.h>
#include <linux/soundwire/sdw_type.h>
@@ -6,18 +6,24 @@
* Cirrus Logic International Semiconductor Ltd.
*/
+#include <linux/array_size.h>
#include <linux/bitops.h>
#include <linux/build_bug.h>
#include <linux/delay.h>
+#include <linux/device.h>
#include <linux/err.h>
-#include <linux/errno.h>
#include <linux/firmware.h>
+#include <linux/gpio/consumer.h>
#include <linux/jiffies.h>
#include <linux/mfd/core.h>
+#include <linux/mfd/cs42l43.h>
#include <linux/mfd/cs42l43-regs.h>
#include <linux/module.h>
+#include <linux/pm.h>
#include <linux/pm_runtime.h>
+#include <linux/regmap.h>
#include <linux/soundwire/sdw.h>
+#include <linux/types.h>
#include "cs42l43.h"
@@ -6,15 +6,17 @@
* Cirrus Logic International Semiconductor Ltd.
*/
-#include <linux/mfd/cs42l43.h>
-#include <linux/pm.h>
-#include <linux/regmap.h>
-
#ifndef CS42L43_CORE_INT_H
#define CS42L43_CORE_INT_H
+#include <linux/pm.h>
+#include <linux/regmap.h>
+
#define CS42L43_N_DEFAULTS 176
+struct cs42l43;
+struct device;
+
extern const struct dev_pm_ops cs42l43_pm_ops;
extern const struct reg_default cs42l43_reg_default[CS42L43_N_DEFAULTS];
@@ -6,20 +6,21 @@
* Cirrus Logic International Semiconductor Ltd.
*/
+#ifndef CS42L43_CORE_EXT_H
+#define CS42L43_CORE_EXT_H
+
#include <linux/completion.h>
-#include <linux/device.h>
-#include <linux/gpio/consumer.h>
#include <linux/mutex.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
-#include <linux/soundwire/sdw.h>
#include <linux/workqueue.h>
-#ifndef CS42L43_CORE_EXT_H
-#define CS42L43_CORE_EXT_H
-
#define CS42L43_N_SUPPLIES 3
+struct device;
+struct gpio_desc;
+struct sdw_slave;
+
enum cs42l43_irq_numbers {
CS42L43_PLL_LOST_LOCK,
CS42L43_PLL_READY,