watchdog: Explicitly include correct DT includes
Subsystems (13)
PATCH v2 1/1 watchdog: Explicitly include correct DT includes
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.
---
v2:
- Add gef_wdt.c and mpc8xxx_wdt.c
--- drivers/watchdog/armada_37xx_wdt.c | 1 - drivers/watchdog/at91rm9200_wdt.c | 3 +-- drivers/watchdog/cpwd.c | 2 +- drivers/watchdog/ftwdt010_wdt.c | 6 ++---- drivers/watchdog/gef_wdt.c | 2 +- drivers/watchdog/imx2_wdt.c | 3 +-- drivers/watchdog/imx7ulp_wdt.c | 1 - drivers/watchdog/meson_wdt.c | 4 ++-- drivers/watchdog/mpc8xxx_wdt.c | 4 ++-- drivers/watchdog/mtk_wdt.c | 1 - drivers/watchdog/of_xilinx_wdt.c | 3 +-- drivers/watchdog/pic32-dmt.c | 3 +-- drivers/watchdog/pic32-wdt.c | 3 +-- drivers/watchdog/pika_wdt.c | 2 +- drivers/watchdog/qcom-wdt.c | 1 - drivers/watchdog/rave-sp-wdt.c | 2 +- drivers/watchdog/riowd.c | 2 +- drivers/watchdog/rza_wdt.c | 4 ++-- drivers/watchdog/rzg2l_wdt.c | 2 +- drivers/watchdog/s3c2410_wdt.c | 1 - drivers/watchdog/sama5d4_wdt.c | 1 - drivers/watchdog/sbsa_gwdt.c | 3 +-- drivers/watchdog/starfive-wdt.c | 3 ++- drivers/watchdog/stm32_iwdg.c | 1 - drivers/watchdog/sunxi_wdt.c | 1 - drivers/watchdog/xilinx_wwdt.c | 4 ++-- 26 files changed, 24 insertions(+), 39 deletions(-)
drivers/watchdog/armada_37xx_wdt.c +0 -1
@@ -14,7 +14,6 @@#include <linux/module.h> #include <linux/moduleparam.h> #include <linux/of.h> -#include <linux/of_device.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/types.h>
drivers/watchdog/at91rm9200_wdt.c +1 -2
@@ -18,6 +18,7 @@#include <linux/mfd/syscon.h> #include <linux/mfd/syscon/atmel-st.h> #include <linux/miscdevice.h> +#include <linux/mod_devicetable.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/platform_device.h>
@@ -26,8 +27,6 @@#include <linux/types.h> #include <linux/watchdog.h> #include <linux/uaccess.h> -#include <linux/of.h> -#include <linux/of_device.h> #define WDT_DEFAULT_TIME 5/* seconds */ #define WDT_MAX_TIME 256/* seconds */
drivers/watchdog/cpwd.c +1 -1
@@ -31,7 +31,7 @@#include <linux/mutex.h> #include <linux/io.h> #include <linux/of.h> -#include <linux/of_device.h> +#include <linux/platform_device.h> #include <linux/uaccess.h> #include <asm/irq.h>
drivers/watchdog/ftwdt010_wdt.c +2 -4
@@ -14,7 +14,7 @@#include <linux/io.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/slab.h> #include <linux/watchdog.h>
@@ -221,20 +221,18 @@ static const struct dev_pm_ops ftwdt010_wdt_dev_pm_ops = { ftwdt010_wdt_resume) }; -#ifdef CONFIG_OF static const struct of_device_id ftwdt010_wdt_match[] = { { .compatible ="faraday,ftwdt010" }, { .compatible ="cortina,gemini-watchdog" }, {}, };MODULE_DEVICE_TABLE (of, ftwdt010_wdt_match); -#endif static struct platform_driver ftwdt010_wdt_driver = { .probe = ftwdt010_wdt_probe, .driver = { .name ="ftwdt010-wdt" , - .of_match_table =of_match_ptr (ftwdt010_wdt_match), + .of_match_table = ftwdt010_wdt_match, .pm = &ftwdt010_wdt_dev_pm_ops, }, };
drivers/watchdog/gef_wdt.c +1 -1
@@ -31,7 +31,7 @@#include <linux/fs.h> #include <linux/of.h> #include <linux/of_address.h> -#include <linux/of_platform.h> +#include <linux/platform_device.h> #include <linux/io.h> #include <linux/uaccess.h>
drivers/watchdog/imx2_wdt.c +1 -2
@@ -26,8 +26,7 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/moduleparam.h> -#include <linux/of_address.h> -#include <linux/of_device.h> +#include <linux/of.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/watchdog.h>
drivers/watchdog/imx7ulp_wdt.c +0 -1
@@ -9,7 +9,6 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/of_device.h> #include <linux/platform_device.h> #include <linux/reboot.h> #include <linux/watchdog.h>
drivers/watchdog/meson_wdt.c +2 -2
@@ -11,11 +11,11 @@#include <linux/init.h> #include <linux/io.h> #include <linux/kernel.h> +#include <linux/mod_devicetable.h> #include <linux/module.h> #include <linux/moduleparam.h> -#include <linux/of.h> -#include <linux/of_device.h> #include <linux/platform_device.h> +#include <linux/property.h> #include <linux/types.h> #include <linux/watchdog.h>
drivers/watchdog/mpc8xxx_wdt.c +2 -2
@@ -16,8 +16,8 @@#include <linux/fs.h> #include <linux/init.h> #include <linux/kernel.h> -#include <linux/of_address.h> -#include <linux/of_platform.h> +#include <linux/of.h> +#include <linux/platform_device.h> #include <linux/module.h> #include <linux/watchdog.h> #include <linux/io.h>
drivers/watchdog/mtk_wdt.c +0 -1
@@ -25,7 +25,6 @@#include <linux/module.h> #include <linux/moduleparam.h> #include <linux/of.h> -#include <linux/of_device.h> #include <linux/platform_device.h> #include <linux/reset-controller.h> #include <linux/types.h>
drivers/watchdog/of_xilinx_wdt.c +1 -2
@@ -10,14 +10,13 @@#include <linux/clk.h> #include <linux/err.h> #include <linux/module.h> +#include <linux/platform_device.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/ioport.h> #include <linux/watchdog.h> #include <linux/io.h> #include <linux/of.h> -#include <linux/of_device.h> -#include <linux/of_address.h> /* Register offsets for the Wdt device */ #define XWT_TWCSR0_OFFSET 0x0/* Control/Status Register0 */
drivers/watchdog/pic32-dmt.c +1 -2
@@ -10,9 +10,8 @@#include <linux/err.h> #include <linux/io.h> #include <linux/kernel.h> +#include <linux/mod_devicetable.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/watchdog.h>
drivers/watchdog/pic32-wdt.c +1 -2
@@ -10,9 +10,8 @@#include <linux/err.h> #include <linux/io.h> #include <linux/kernel.h> +#include <linux/mod_devicetable.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/watchdog.h>
drivers/watchdog/pika_wdt.c +1 -1
@@ -23,8 +23,8 @@#include <linux/bitops.h> #include <linux/uaccess.h> #include <linux/io.h> +#include <linux/of.h> #include <linux/of_address.h> -#include <linux/of_platform.h> #define DRV_NAME "PIKA-WDT"
drivers/watchdog/qcom-wdt.c +0 -1
@@ -11,7 +11,6 @@#include <linux/of.h> #include <linux/platform_device.h> #include <linux/watchdog.h> -#include <linux/of_device.h> enum wdt_reg {WDT_RST ,
drivers/watchdog/rave-sp-wdt.c +1 -1
@@ -13,7 +13,7 @@#include <linux/mfd/rave-sp.h> #include <linux/module.h> #include <linux/nvmem-consumer.h> -#include <linux/of_device.h> +#include <linux/of.h> #include <linux/platform_device.h> #include <linux/reboot.h> #include <linux/slab.h>
drivers/watchdog/riowd.c +1 -1
@@ -14,7 +14,7 @@#include <linux/miscdevice.h> #include <linux/watchdog.h> #include <linux/of.h> -#include <linux/of_device.h> +#include <linux/platform_device.h> #include <linux/io.h> #include <linux/uaccess.h> #include <linux/slab.h>
drivers/watchdog/rza_wdt.c +2 -2
@@ -9,9 +9,9 @@#include <linux/bitops.h> #include <linux/clk.h> #include <linux/delay.h> +#include <linux/io.h> #include <linux/module.h> -#include <linux/of_address.h> -#include <linux/of_device.h> +#include <linux/of.h> #include <linux/platform_device.h> #include <linux/watchdog.h>
drivers/watchdog/rzg2l_wdt.c +1 -1
@@ -11,7 +11,7 @@#include <linux/iopoll.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/pm_runtime.h> #include <linux/reset.h>
drivers/watchdog/s3c2410_wdt.c +0 -1
@@ -23,7 +23,6 @@#include <linux/slab.h> #include <linux/err.h> #include <linux/of.h> -#include <linux/of_device.h> #include <linux/mfd/syscon.h> #include <linux/regmap.h> #include <linux/delay.h>
drivers/watchdog/sama5d4_wdt.c +0 -1
@@ -11,7 +11,6 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/of_device.h> #include <linux/of_irq.h> #include <linux/platform_device.h> #include <linux/reboot.h>
drivers/watchdog/sbsa_gwdt.c +1 -2
@@ -43,10 +43,9 @@#include <linux/io.h> #include <linux/io-64-nonatomic-lo-hi.h> #include <linux/interrupt.h> +#include <linux/mod_devicetable.h> #include <linux/module.h> #include <linux/moduleparam.h> -#include <linux/of.h> -#include <linux/of_device.h> #include <linux/platform_device.h> #include <linux/uaccess.h> #include <linux/watchdog.h>
drivers/watchdog/starfive-wdt.c +2 -1
@@ -8,7 +8,8 @@#include <linux/clk.h> #include <linux/iopoll.h> #include <linux/module.h> -#include <linux/of_device.h> +#include <linux/of.h> +#include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/reset.h> #include <linux/watchdog.h>
drivers/watchdog/stm32_iwdg.c +0 -1
@@ -17,7 +17,6 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/of_device.h> #include <linux/platform_device.h> #include <linux/watchdog.h>
drivers/watchdog/sunxi_wdt.c +0 -1
@@ -18,7 +18,6 @@#include <linux/module.h> #include <linux/moduleparam.h> #include <linux/of.h> -#include <linux/of_device.h> #include <linux/platform_device.h> #include <linux/types.h> #include <linux/watchdog.h>
drivers/watchdog/xilinx_wwdt.c +2 -2
@@ -9,9 +9,9 @@#include <linux/interrupt.h> #include <linux/io.h> #include <linux/ioport.h> +#include <linux/mod_devicetable.h> #include <linux/module.h> -#include <linux/of_device.h> -#include <linux/of_address.h> +#include <linux/platform_device.h> #include <linux/watchdog.h> /* Max timeout is calculated at 100MHz source clock */
Signature · 1 line
2.40.1
kernel test robot
build botkernel test robot noticed the following build warnings:
Hi Rob,
kernel test robot noticed the following build warnings:
[auto build test WARNING on krzk/for-next]
[also build test WARNING on groeck-staging/hwmon-next linus/master v6.5-rc3 next-20230724] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Rob-Herring/watchdog-Explicitly-include-correct-DT-includes/20230725-045823 base: https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux.git for-next patch link: https://lore.kernel.org/r/20230724205503.767612-1-robh%40kernel.org patch subject: [PATCH v2] watchdog: Explicitly include correct DT includes config: mips-allyesconfig (https://download.01.org/0day-ci/archive/20230725/[email protected]/config) compiler: mips-linux-gcc (GCC) 12.3.0 reproduce: (https://download.01.org/0day-ci/archive/20230725/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
drivers/watchdog/pic32-wdt.c:220:35: error: implicit declaration of function 'of_match_ptr' [-Werror=implicit-function-declaration]
220 | .of_match_table = of_match_ptr(pic32_wdt_dt_ids),
| ^~~~~~~~~~~~
>> drivers/watchdog/pic32-wdt.c:220:35: warning: initialization of 'const struct of_device_id *' from 'int' makes pointer from integer without a cast [-Wint-conversion] drivers/watchdog/pic32-wdt.c:220:35: note: (near initialization for 'pic32_wdt_driver.driver.of_match_table') drivers/watchdog/pic32-wdt.c:220:35: error: initializer element is not constant drivers/watchdog/pic32-wdt.c:220:35: note: (near initialization for 'pic32_wdt_driver.driver.of_match_table')
cc1: some warnings being treated as errors
--
drivers/watchdog/pic32-dmt.c:218:35: error: implicit declaration of function 'of_match_ptr' [-Werror=implicit-function-declaration]
218 | .of_match_table = of_match_ptr(pic32_dmt_of_ids),
| ^~~~~~~~~~~~
>> drivers/watchdog/pic32-dmt.c:218:35: warning: initialization of 'const struct of_device_id *' from 'int' makes pointer from integer without a cast [-Wint-conversion] drivers/watchdog/pic32-dmt.c:218:35: note: (near initialization for 'pic32_dmt_driver.driver.of_match_table') drivers/watchdog/pic32-dmt.c:218:35: error: initializer element is not constant drivers/watchdog/pic32-dmt.c:218:35: note: (near initialization for 'pic32_dmt_driver.driver.of_match_table')
cc1: some warnings being treated as errors
vim +220 drivers/watchdog/pic32-wdt.c
8f91fc56bc439a Joshua Henderson 2016-02-26 215
8f91fc56bc439a Joshua Henderson 2016-02-26 216 static struct platform_driver pic32_wdt_driver = {
8f91fc56bc439a Joshua Henderson 2016-02-26 217 .probe = pic32_wdt_drv_probe,
8f91fc56bc439a Joshua Henderson 2016-02-26 218 .driver = {
8f91fc56bc439a Joshua Henderson 2016-02-26 219 .name = "pic32-wdt",
8f91fc56bc439a Joshua Henderson 2016-02-26 @220 .of_match_table = of_match_ptr(pic32_wdt_dt_ids),
8f91fc56bc439a Joshua Henderson 2016-02-26 221 }
8f91fc56bc439a Joshua Henderson 2016-02-26 222 };8f91fc56bc439a Joshua Henderson 2016-02-26 223
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
kernel test robot
build botkernel test robot noticed the following build errors:
Hi Rob,
kernel test robot noticed the following build errors:
[auto build test ERROR on krzk/for-next]
[also build test ERROR on groeck-staging/hwmon-next linus/master v6.5-rc3 next-20230724] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Rob-Herring/watchdog-Explicitly-include-correct-DT-includes/20230725-045823 base: https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux.git for-next patch link: https://lore.kernel.org/r/20230724205503.767612-1-robh%40kernel.org patch subject: [PATCH v2] watchdog: Explicitly include correct DT includes config: mips-randconfig-r022-20230724 (https://download.01.org/0day-ci/archive/20230725/[email protected]/config) compiler: mips64-linux-gcc (GCC) 12.3.0 reproduce: (https://download.01.org/0day-ci/archive/20230725/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All error/warnings (new ones prefixed by >>):
>> drivers/watchdog/pic32-dmt.c:218:35: error: implicit declaration of function 'of_match_ptr' [-Werror=implicit-function-declaration]
218 | .of_match_table = of_match_ptr(pic32_dmt_of_ids),
| ^~~~~~~~~~~~
>> drivers/watchdog/pic32-dmt.c:218:35: warning: initialization of 'const struct of_device_id *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
drivers/watchdog/pic32-dmt.c:218:35: note: (near initialization for 'pic32_dmt_driver.driver.of_match_table')
>> drivers/watchdog/pic32-dmt.c:218:35: error: initializer element is not constant drivers/watchdog/pic32-dmt.c:218:35: note: (near initialization for 'pic32_dmt_driver.driver.of_match_table')
cc1: some warnings being treated as errors
vim +/of_match_ptr +218 drivers/watchdog/pic32-dmt.c
b0d8a082ce9c82 Purna Chandra Mandal 2016-02-26 213
b0d8a082ce9c82 Purna Chandra Mandal 2016-02-26 214 static struct platform_driver pic32_dmt_driver = {
b0d8a082ce9c82 Purna Chandra Mandal 2016-02-26 215 .probe = pic32_dmt_probe,
b0d8a082ce9c82 Purna Chandra Mandal 2016-02-26 216 .driver = {
b0d8a082ce9c82 Purna Chandra Mandal 2016-02-26 217 .name = "pic32-dmt",
b0d8a082ce9c82 Purna Chandra Mandal 2016-02-26 @218 .of_match_table = of_match_ptr(pic32_dmt_of_ids),
b0d8a082ce9c82 Purna Chandra Mandal 2016-02-26 219 }
b0d8a082ce9c82 Purna Chandra Mandal 2016-02-26 220 };b0d8a082ce9c82 Purna Chandra Mandal 2016-02-26 221
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki