watchdog: imx_sc_wdt: Remove unused includes
Subsystems (2)
PATCH 1/3 watchdog: imx_sc_wdt: Remove unused includes
There is nothing in use from init.h/reboot.h, remove them.
--- drivers/watchdog/imx_sc_wdt.c | 2 -- 1 file changed, 2 deletions(-)
drivers/watchdog/imx_sc_wdt.c +0 -2
@@ -6,13 +6,11 @@#include <linux/arm-smccc.h> #include <linux/firmware/imx/sci.h> #include <linux/io.h> -#include <linux/init.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/of.h> #include <linux/platform_device.h> -#include <linux/reboot.h> #include <linux/watchdog.h> #define DEFAULT_TIMEOUT 60
Signature · 1 line
2.7.4
PATCH 2/3 watchdog: imx7ulp: Remove unused include of init.h
There is nothing in use from init.h, remove it.
--- drivers/watchdog/imx7ulp_wdt.c | 1 - 1 file changed, 1 deletion(-)
drivers/watchdog/imx7ulp_wdt.c +0 -1
@@ -4,7 +4,6 @@*/ #include <linux/clk.h> -#include <linux/init.h> #include <linux/io.h> #include <linux/kernel.h> #include <linux/module.h>
Signature · 1 line
2.7.4
Re: [PATCH 2/3] watchdog: imx7ulp: Remove unused include of init.h
Quoted 3 lines · Anson Huang
There is nothing in use from
init.h, remove it.Signed-off-by Anson Huang <[email protected]>
Quoted 16 lines
--- drivers/watchdog/imx7ulp_wdt.c | 1 - 1 file changed, 1 deletion(-)drivers/watchdog/imx7ulp_wdt.c +0
-1@@ -4,7 +4,6 @@*/ #include <linux/clk.h> -#include <linux/init.h> #include <linux/io.h> #include <linux/kernel.h> #include <linux/module.h>
PATCH 3/3 watchdog: imx2_wdt: Remove unused include of init.h
In reply to Anson HuangThere is nothing in use from init.h, remove it.
--- drivers/watchdog/imx2_wdt.c | 1 - 1 file changed, 1 deletion(-)
drivers/watchdog/imx2_wdt.c +0 -1
@@ -20,7 +20,6 @@#include <linux/clk.h> #include <linux/delay.h> -#include <linux/init.h> #include <linux/interrupt.h> #include <linux/io.h> #include <linux/kernel.h>
Signature · 1 line
2.7.4
Re: [PATCH 3/3] watchdog: imx2_wdt: Remove unused include of init.h
Quoted 2 lines · Anson Huang
There is nothing in use from
init.h, remove it.
NACK, sorry; this driver uses __init and __exit_p.
Guenter
Quoted 17 lines
Signed-off-by Anson Huang <[email protected]>--- drivers/watchdog/imx2_wdt.c | 1 - 1 file changed, 1 deletion(-)drivers/watchdog/imx2_wdt.c +0
-1@@ -20,7 +20,6 @@#include <linux/clk.h> #include <linux/delay.h> -#include <linux/init.h> #include <linux/interrupt.h> #include <linux/io.h> #include <linux/kernel.h>
RE: [PATCH 3/3] watchdog: imx2_wdt: Remove unused include of init.h
Hi, Guenter
Quoted 8 lines
Subject: Re: [PATCH 3/3] watchdog:
imx2_wdt: Remove unused include ofinit.hQuoted 2 lines · Anson Huang
There is nothing in use from
init.h, remove it.NACK, sorry; this driver uses
__initand__exit_p.
Ah, yes, just notice them. But I don't understand why the .probe callback needs __init and .remove callback needs __exit_p? Should they need to be removed?
Thanks,
Anson
Quoted 13 lines
Guenter
Quoted 11 lines
Signed-off-by Anson Huang <[email protected]>--- drivers/watchdog/imx2_wdt.c | 1 - 1 file changed, 1 deletion(-)drivers/watchdog/imx2_wdt.c +0
-0@@ -20,7 +20,6 @@
Quoted 6 lines
drivers/watchdog/imx2_wdt.c line 25
Quoted 6 lines
drivers/watchdog/imx2_wdt.c +0
-1#include <linux/clk.h> #include <linux/delay.h> -#include <linux/init.h> #include <linux/interrupt.h> #include <linux/io.h> #include <linux/kernel.h>
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Guenter Roeck
maintainerRe: [PATCH 3/3] watchdog: imx2_wdt: Remove unused include of init.h
Quoted 5 lines · Anson Huang
Hi, Guenter
Quoted 3 lines
Subject: Re: [PATCH 3/3] watchdog:
imx2_wdt: Remove unused include ofinit.h
Quoted 9 lines
Quoted 5 lines · Anson Huang
Quoted 2 lines
There is nothing in use from
init.h, remove it.NACK, sorry; this driver uses
__initand__exit_p.Ah, yes, just notice them. But I don't understand why the .probe callback needs
__initand .remove callback needs__exit_p? Should they need to be removed?
That is not a matter of "needs". __init causes the code to be removed after initialization. This is ok and desirable if it is known that the hardware is built-in and will only ever be probed once.
exit_p causes the code to be removed if it is built into the kernel. This is desirable and makes sense if the device is known to never be removed.
Having said that, what _is_ unnecessary is the remove function. Registration could use devm_watchdog_register_device(), and the watchdog subsystem should prevent removal if the watchdog is running. Plus, the removal function is
buggy: It doesn' call clk_disable_unprepare() (but that could be handled with devm_add_action_or_reset() in the probe function). In my opinion, fixing all that would be more valuable than trying to drop an include file.
Thanks,
Guenter
RE: [PATCH 3/3] watchdog: imx2_wdt: Remove unused include of init.h
Hi, Guenter
Quoted 20 lines
Subject: Re: [PATCH 3/3] watchdog:
imx2_wdt: Remove unused include ofinit.hQuoted 5 lines · Anson Huang
Hi, Guenter
Quoted 3 lines
Subject: Re: [PATCH 3/3] watchdog:
imx2_wdt: Remove unused include ofinit.hQuoted 8 lines
Quoted 5 lines · Anson Huang
Quoted 2 lines
There is nothing in use from
init.h, remove it.NACK, sorry; this driver uses
__initand__exit_p.Ah, yes, just notice them. But I don't understand why the .probe callback needs
__initand .remove callback needs__exit_p? Should theyneed to be removed?
Quoted 1 line
Quoted 6 lines
That is not a matter of "needs".
__initcauses the code to be removed after initialization. This is ok and desirable if it is known that the hardware is built- in and will only ever be probed once.
exit_pcauses the code to be removed if it is built into the kernel. This is desirable and makes sense if the device is known to never be removed.
Make sense, for now, there is no i.MX SoC needs watchdog driver as module, so I will keep it here.
Quoted 8 lines
Having said that, what _is_ unnecessary is the remove function. Registration could use
devm_watchdog_register_device(), and the watchdog subsystem should prevent removal if the watchdog is running. Plus, the removal function is
buggy: It doesn' callclk_disable_unprepare()(but that could be handled withdevm_add_action_or_reset()in the probe function). In my opinion, fixing all that would be more valuable than trying to drop an include file.
Thanks for pointing out the clock operation issue in .remove callback, I will cut a patch using devm_watchdog_register_device() and devm_add_action_or_reset() to handle all necessary operations for remove action, then drop .remove callback.
Thanks,
Anson
Quoted 3 lines · Anson Huang
There is nothing in use from
init.h/reboot.h, remove them.Signed-off-by Anson Huang <[email protected]>
Quoted 23 lines
--- drivers/watchdog/imx_sc_wdt.c | 2 -- 1 file changed, 2 deletions(-)drivers/watchdog/imx_sc_wdt.c +0
-2@@ -6,13 +6,11 @@#include <linux/arm-smccc.h> #include <linux/firmware/imx/sci.h> #include <linux/io.h> -#include <linux/init.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/of.h> #include <linux/platform_device.h> -#include <linux/reboot.h> #include <linux/watchdog.h> #define DEFAULT_TIMEOUT 60