[v2] power: Explicitly include correct DT includes
Commit Message
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.
Acked-by: David Lechner <david@lechnology.com>
Signed-off-by: Rob Herring <robh@kernel.org>
---
v2:
- Fix double include of of.h
---
drivers/power/reset/as3722-poweroff.c | 1 -
drivers/power/reset/brcm-kona-reset.c | 4 ++--
drivers/power/reset/gpio-poweroff.c | 3 ++-
drivers/power/reset/gpio-restart.c | 2 +-
drivers/power/reset/keystone-reset.c | 3 ++-
drivers/power/reset/ocelot-reset.c | 4 ++--
drivers/power/reset/odroid-go-ultra-poweroff.c | 3 ++-
drivers/power/reset/oxnas-restart.c | 2 --
drivers/power/reset/st-poweroff.c | 2 +-
drivers/power/reset/syscon-poweroff.c | 3 +--
drivers/power/reset/syscon-reboot.c | 3 +--
drivers/power/reset/xgene-reboot.c | 2 +-
drivers/power/supply/axp20x_ac_power.c | 1 -
drivers/power/supply/axp20x_battery.c | 1 -
drivers/power/supply/axp20x_usb_power.c | 1 -
drivers/power/supply/cpcap-battery.c | 2 +-
drivers/power/supply/da9150-charger.c | 2 --
drivers/power/supply/da9150-fg.c | 1 -
drivers/power/supply/lego_ev3_battery.c | 2 +-
drivers/power/supply/ltc2941-battery-gauge.c | 2 +-
drivers/power/supply/ltc4162-l-charger.c | 2 +-
drivers/power/supply/max14656_charger_detector.c | 2 +-
drivers/power/supply/max17040_battery.c | 2 +-
drivers/power/supply/max8903_charger.c | 1 -
drivers/power/supply/rn5t618_power.c | 1 -
drivers/power/supply/rt5033_charger.c | 2 +-
drivers/power/supply/rt9455_charger.c | 3 +--
drivers/power/supply/sbs-battery.c | 2 +-
drivers/power/supply/tps65090-charger.c | 2 +-
drivers/power/supply/tps65217_charger.c | 1 -
drivers/power/supply/twl4030_charger.c | 1 +
31 files changed, 26 insertions(+), 37 deletions(-)
Comments
On Tue, 18 Jul 2023 at 08:31, Rob Herring <robh@kernel.org> wrote:
>
> The DT of_device.h and of_platform.h date back to the separate
> of_platform_bus_type before it as merged into the regular platform bus.
> As part of that merge prepping Arm DT support 13 years ago, they
> "temporarily" include each other. They also include platform_device.h
> and of.h. As a result, there's a pretty much random mix of those include
> files used throughout the tree. In order to detangle these headers and
> replace the implicit includes with struct declarations, users need to
> explicitly include the correct includes.
>
> Acked-by: David Lechner <david@lechnology.com>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
> v2:
> - Fix double include of of.h
> ---
> drivers/power/reset/as3722-poweroff.c | 1 -
> drivers/power/reset/brcm-kona-reset.c | 4 ++--
> drivers/power/reset/gpio-poweroff.c | 3 ++-
> drivers/power/reset/gpio-restart.c | 2 +-
> drivers/power/reset/keystone-reset.c | 3 ++-
> drivers/power/reset/ocelot-reset.c | 4 ++--
> drivers/power/reset/odroid-go-ultra-poweroff.c | 3 ++-
> drivers/power/reset/oxnas-restart.c | 2 --
> drivers/power/reset/st-poweroff.c | 2 +-
> drivers/power/reset/syscon-poweroff.c | 3 +--
> drivers/power/reset/syscon-reboot.c | 3 +--
> drivers/power/reset/xgene-reboot.c | 2 +-
> drivers/power/supply/axp20x_ac_power.c | 1 -
> drivers/power/supply/axp20x_battery.c | 1 -
> drivers/power/supply/axp20x_usb_power.c | 1 -
> drivers/power/supply/cpcap-battery.c | 2 +-
> drivers/power/supply/da9150-charger.c | 2 --
> drivers/power/supply/da9150-fg.c | 1 -
> drivers/power/supply/lego_ev3_battery.c | 2 +-
> drivers/power/supply/ltc2941-battery-gauge.c | 2 +-
> drivers/power/supply/ltc4162-l-charger.c | 2 +-
> drivers/power/supply/max14656_charger_detector.c | 2 +-
> drivers/power/supply/max17040_battery.c | 2 +-
> drivers/power/supply/max8903_charger.c | 1 -
> drivers/power/supply/rn5t618_power.c | 1 -
> drivers/power/supply/rt5033_charger.c | 2 +-
> drivers/power/supply/rt9455_charger.c | 3 +--
> drivers/power/supply/sbs-battery.c | 2 +-
> drivers/power/supply/tps65090-charger.c | 2 +-
> drivers/power/supply/tps65217_charger.c | 1 -
> drivers/power/supply/twl4030_charger.c | 1 +
> 31 files changed, 26 insertions(+), 37 deletions(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
Hi,
On Tue, Jul 18, 2023 at 07:08:01PM -0600, Simon Glass wrote:
> On Tue, 18 Jul 2023 at 08:31, Rob Herring <robh@kernel.org> wrote:
> > The DT of_device.h and of_platform.h date back to the separate
> > of_platform_bus_type before it as merged into the regular platform bus.
> > As part of that merge prepping Arm DT support 13 years ago, they
> > "temporarily" include each other. They also include platform_device.h
> > and of.h. As a result, there's a pretty much random mix of those include
> > files used throughout the tree. In order to detangle these headers and
> > replace the implicit includes with struct declarations, users need to
> > explicitly include the correct includes.
> >
> > Acked-by: David Lechner <david@lechnology.com>
> > Signed-off-by: Rob Herring <robh@kernel.org>
> > ---
> > v2:
> > - Fix double include of of.h
> > ---
> > drivers/power/reset/as3722-poweroff.c | 1 -
> > drivers/power/reset/brcm-kona-reset.c | 4 ++--
> > drivers/power/reset/gpio-poweroff.c | 3 ++-
> > drivers/power/reset/gpio-restart.c | 2 +-
> > drivers/power/reset/keystone-reset.c | 3 ++-
> > drivers/power/reset/ocelot-reset.c | 4 ++--
> > drivers/power/reset/odroid-go-ultra-poweroff.c | 3 ++-
> > drivers/power/reset/oxnas-restart.c | 2 --
> > drivers/power/reset/st-poweroff.c | 2 +-
> > drivers/power/reset/syscon-poweroff.c | 3 +--
> > drivers/power/reset/syscon-reboot.c | 3 +--
> > drivers/power/reset/xgene-reboot.c | 2 +-
> > drivers/power/supply/axp20x_ac_power.c | 1 -
> > drivers/power/supply/axp20x_battery.c | 1 -
> > drivers/power/supply/axp20x_usb_power.c | 1 -
> > drivers/power/supply/cpcap-battery.c | 2 +-
> > drivers/power/supply/da9150-charger.c | 2 --
> > drivers/power/supply/da9150-fg.c | 1 -
> > drivers/power/supply/lego_ev3_battery.c | 2 +-
> > drivers/power/supply/ltc2941-battery-gauge.c | 2 +-
> > drivers/power/supply/ltc4162-l-charger.c | 2 +-
> > drivers/power/supply/max14656_charger_detector.c | 2 +-
> > drivers/power/supply/max17040_battery.c | 2 +-
> > drivers/power/supply/max8903_charger.c | 1 -
> > drivers/power/supply/rn5t618_power.c | 1 -
> > drivers/power/supply/rt5033_charger.c | 2 +-
> > drivers/power/supply/rt9455_charger.c | 3 +--
> > drivers/power/supply/sbs-battery.c | 2 +-
> > drivers/power/supply/tps65090-charger.c | 2 +-
> > drivers/power/supply/tps65217_charger.c | 1 -
> > drivers/power/supply/twl4030_charger.c | 1 +
> > 31 files changed, 26 insertions(+), 37 deletions(-)
>
> Reviewed-by: Simon Glass <sjg@chromium.org>
Thanks, queued.
-- Sebastian
@@ -10,7 +10,6 @@
#include <linux/mfd/as3722.h>
#include <linux/module.h>
#include <linux/of.h>
-#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
@@ -2,8 +2,8 @@
// Copyright (C) 2016 Broadcom
#include <linux/io.h>
-#include <linux/of_address.h>
-#include <linux/of_platform.h>
+#include <linux/mod_devicetable.h>
+#include <linux/platform_device.h>
#include <linux/reboot.h>
#define RSTMGR_REG_WR_ACCESS_OFFSET 0
@@ -11,8 +11,9 @@
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
+#include <linux/property.h>
#include <linux/gpio/consumer.h>
-#include <linux/of_platform.h>
+#include <linux/mod_devicetable.h>
#include <linux/module.h>
#define DEFAULT_TIMEOUT_MS 3000
@@ -12,8 +12,8 @@
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/gpio/consumer.h>
-#include <linux/of_platform.h>
#include <linux/module.h>
+#include <linux/of.h>
struct gpio_restart {
struct gpio_desc *reset_gpio;
@@ -10,10 +10,11 @@
#include <linux/io.h>
#include <linux/module.h>
#include <linux/notifier.h>
+#include <linux/platform_device.h>
#include <linux/reboot.h>
#include <linux/regmap.h>
#include <linux/mfd/syscon.h>
-#include <linux/of_platform.h>
+#include <linux/of.h>
#define RSTYPE_RG 0x0
#define RSCTRL_RG 0x4
@@ -8,10 +8,10 @@
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/notifier.h>
+#include <linux/mod_devicetable.h>
#include <linux/mfd/syscon.h>
-#include <linux/of_address.h>
-#include <linux/of_device.h>
#include <linux/platform_device.h>
+#include <linux/property.h>
#include <linux/reboot.h>
#include <linux/regmap.h>
@@ -4,7 +4,8 @@
*/
#include <linux/kernel.h>
#include <linux/init.h>
-#include <linux/of_platform.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
#include <linux/mfd/rk808.h>
#include <linux/regmap.h>
#include <linux/module.h>
@@ -13,8 +13,6 @@
#include <linux/io.h>
#include <linux/notifier.h>
#include <linux/mfd/syscon.h>
-#include <linux/of_address.h>
-#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/reboot.h>
#include <linux/regmap.h>
@@ -9,7 +9,7 @@
#include <linux/module.h>
#include <linux/of.h>
-#include <linux/of_platform.h>
+#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/mfd/syscon.h>
#include <linux/reboot.h>
@@ -10,8 +10,7 @@
#include <linux/io.h>
#include <linux/notifier.h>
#include <linux/mfd/syscon.h>
-#include <linux/of_address.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pm.h>
#include <linux/regmap.h>
@@ -9,8 +9,7 @@
#include <linux/io.h>
#include <linux/notifier.h>
#include <linux/mfd/syscon.h>
-#include <linux/of_address.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/reboot.h>
#include <linux/regmap.h>
@@ -13,7 +13,7 @@
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/notifier.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/platform_device.h>
#include <linux/reboot.h>
@@ -13,7 +13,6 @@
#include <linux/mfd/axp20x.h>
#include <linux/module.h>
#include <linux/of.h>
-#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/pm.h>
#include <linux/power_supply.h>
@@ -22,7 +22,6 @@
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/of.h>
-#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/regmap.h>
@@ -15,7 +15,6 @@
#include <linux/mfd/axp20x.h>
#include <linux/module.h>
#include <linux/of.h>
-#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/pm.h>
#include <linux/power_supply.h>
@@ -15,7 +15,7 @@
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/reboot.h>
@@ -11,8 +11,6 @@
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/platform_device.h>
-#include <linux/of.h>
-#include <linux/of_platform.h>
#include <linux/interrupt.h>
#include <linux/power_supply.h>
#include <linux/notifier.h>
@@ -11,7 +11,6 @@
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/of.h>
-#include <linux/of_platform.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
@@ -20,7 +20,7 @@
#include <linux/iio/types.h>
#include <linux/kernel.h>
#include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/mod_devicetable.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
@@ -11,7 +11,7 @@
#include <linux/devm-helpers.h>
#include <linux/kernel.h>
#include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/swab.h>
@@ -6,7 +6,7 @@
#include <linux/module.h>
#include <linux/delay.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
#include <linux/pm_runtime.h>
#include <linux/power_supply.h>
#include <linux/i2c.h>
@@ -14,8 +14,8 @@
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
+#include <linux/mod_devicetable.h>
#include <linux/slab.h>
-#include <linux/of_device.h>
#include <linux/workqueue.h>
#include <linux/power_supply.h>
#include <linux/devm-helpers.h>
@@ -15,7 +15,7 @@
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/power_supply.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
#include <linux/regmap.h>
#include <linux/slab.h>
@@ -10,7 +10,6 @@
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/of.h>
-#include <linux/of_device.h>
#include <linux/slab.h>
#include <linux/power_supply.h>
#include <linux/platform_device.h>
@@ -14,7 +14,6 @@
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/mfd/rn5t618.h>
-#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/regmap.h>
@@ -6,8 +6,8 @@
* Author: Beomho Seo <beomho.seo@samsung.com>
*/
+#include <linux/mod_devicetable.h>
#include <linux/module.h>
-#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/regmap.h>
@@ -8,8 +8,7 @@
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
-#include <linux/of_irq.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
#include <linux/pm_runtime.h>
#include <linux/power_supply.h>
#include <linux/i2c.h>
@@ -16,7 +16,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/property.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
#include <linux/power/sbs-battery.h>
#include <linux/power_supply.h>
#include <linux/slab.h>
@@ -13,7 +13,7 @@
#include <linux/kernel.h>
#include <linux/kthread.h>
#include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/slab.h>
@@ -17,7 +17,6 @@
#include <linux/slab.h>
#include <linux/err.h>
#include <linux/of.h>
-#include <linux/of_device.h>
#include <linux/power_supply.h>
#include <linux/mfd/core.h>
@@ -12,6 +12,7 @@
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/err.h>
+#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/mfd/twl.h>