mbox series

[RFC,0/9] watchdog: don't print out if registering watchdog fails

Message ID 20241004200314.5459-1-wsa+renesas@sang-engineering.com
Headers show
Series watchdog: don't print out if registering watchdog fails | expand

Message

Wolfram Sang Oct. 4, 2024, 8:03 p.m. UTC
While working with the rza-driver, I noticed that the watchdog core does
not always print out errors when registering a watchdog fails. Only most
of the time. With a simple refactoring, it will always print out. We can
remove similar printouts then from drivers. This series does exactly
that. Not sure about the core change, thus still RFC. There are two more
drivers outside the 'watchdog' dir which could benefit from this change,
but I left them out for now until I know this path is acceptable.

Looking forward to comments...


Wolfram Sang (9):
  watchdog: always print when registering watchdog fails
  watchdog: da9055_wdt: don't print out if registering watchdog fails
  watchdog: hpe-wdt: don't print out if registering watchdog fails
  watchdog: iTCO_wdt: don't print out if registering watchdog fails
  watchdog: it87_wdt: don't print out if registering watchdog fails
  watchdog: octeon-wdt: don't print out if registering watchdog fails
  watchdog: rti_wdt: don't print out if registering watchdog fails
  watchdog: rza_wdt: don't print out if registering watchdog fails
  watchdog: sl28cpld_wdt: don't print out if registering watchdog fails

 drivers/watchdog/da9055_wdt.c      |  7 +------
 drivers/watchdog/gxp-wdt.c         |  4 +---
 drivers/watchdog/iTCO_wdt.c        |  4 +---
 drivers/watchdog/it87_wdt.c        |  4 +---
 drivers/watchdog/octeon-wdt-main.c |  4 +---
 drivers/watchdog/rti_wdt.c         |  4 +---
 drivers/watchdog/rza_wdt.c         |  7 +------
 drivers/watchdog/sl28cpld_wdt.c    |  4 +---
 drivers/watchdog/watchdog_core.c   | 26 +++++++++++++++++---------
 9 files changed, 25 insertions(+), 39 deletions(-)

Comments

Guenter Roeck Oct. 4, 2024, 8:52 p.m. UTC | #1
On Fri, Oct 04, 2024 at 10:03:04PM +0200, Wolfram Sang wrote:
> So far, only 'watchdog_register_device' prints an error if registering
> the watchdog driver fails. '__watchdog_register_device' doesn't.
> Refactor the code so that both print out. Drivers can then rely on that
> and skip their own error messages.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Guenter Roeck Oct. 4, 2024, 8:53 p.m. UTC | #2
On Fri, Oct 04, 2024 at 10:03:06PM +0200, Wolfram Sang wrote:
> The core will do this already.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Guenter Roeck Oct. 4, 2024, 8:53 p.m. UTC | #3
On Fri, Oct 04, 2024 at 10:03:08PM +0200, Wolfram Sang wrote:
> The core will do this already.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Guenter Roeck Oct. 4, 2024, 8:54 p.m. UTC | #4
On Fri, Oct 04, 2024 at 10:03:10PM +0200, Wolfram Sang wrote:
> The core will do this already.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Guenter Roeck Oct. 4, 2024, 8:54 p.m. UTC | #5
On Fri, Oct 04, 2024 at 10:03:12PM +0200, Wolfram Sang wrote:
> The core will do this already.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Jerry Hoemann Oct. 4, 2024, 9:29 p.m. UTC | #6
On Fri, Oct 04, 2024 at 10:03:06PM +0200, Wolfram Sang wrote:
> The core will do this already.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
>  drivers/watchdog/gxp-wdt.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

Question:  should email have been titled
	"watchdog: gxp-wdt: ..."
instead of
	"watchdog: hpe-wdt: ..."

to match the module name as the email title gets put into
the git log for the file?

Thanks

Jerry


> 
> diff --git a/drivers/watchdog/gxp-wdt.c b/drivers/watchdog/gxp-wdt.c
> index 2fd85be88278..f2c236160266 100644
> --- a/drivers/watchdog/gxp-wdt.c
> +++ b/drivers/watchdog/gxp-wdt.c
> @@ -151,10 +151,8 @@ static int gxp_wdt_probe(struct platform_device *pdev)
>  
>  	watchdog_stop_on_reboot(&drvdata->wdd);
>  	err = devm_watchdog_register_device(dev, &drvdata->wdd);
> -	if (err) {
> -		dev_err(dev, "Failed to register watchdog device");
> +	if (err)
>  		return err;
> -	}
>  
>  	dev_info(dev, "HPE GXP watchdog timer");
>  
> -- 
> 2.45.2
>
Wolfram Sang Oct. 5, 2024, 5:23 a.m. UTC | #7
On Fri, Oct 04, 2024 at 03:29:09PM -0600, Jerry Hoemann wrote:
> On Fri, Oct 04, 2024 at 10:03:06PM +0200, Wolfram Sang wrote:
> > The core will do this already.
> > 
> > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> > ---
> >  drivers/watchdog/gxp-wdt.c | 4 +---
> >  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> Question:  should email have been titled
> 	"watchdog: gxp-wdt: ..."
> instead of
> 	"watchdog: hpe-wdt: ..."
> 
> to match the module name as the email title gets put into
> the git log for the file?

No objection, we can do that. I check git-log for the prefixes and found
there the following:

6b47441bed49 ("watchdog: hpe-wdt: Introduce HPE GXP Watchdog")

I am fine with both.
Michael Walle Oct. 5, 2024, 11:19 a.m. UTC | #8
> The core will do this already.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Michael Walle <mwalle@kernel.org>

Thanks!
-michael
Jerry Hoemann Oct. 6, 2024, 4:10 p.m. UTC | #9
On Sat, Oct 05, 2024 at 07:23:19AM +0200, Wolfram Sang wrote:
> On Fri, Oct 04, 2024 at 03:29:09PM -0600, Jerry Hoemann wrote:
> > On Fri, Oct 04, 2024 at 10:03:06PM +0200, Wolfram Sang wrote:
> > > The core will do this already.
> > > 
> > > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> > > ---
> > >  drivers/watchdog/gxp-wdt.c | 4 +---
> > >  1 file changed, 1 insertion(+), 3 deletions(-)
> > 
> > Question:  should email have been titled
> > 	"watchdog: gxp-wdt: ..."
> > instead of
> > 	"watchdog: hpe-wdt: ..."
> > 
> > to match the module name as the email title gets put into
> > the git log for the file?
> 
> No objection, we can do that. I check git-log for the prefixes and found
> there the following:
> 
> 6b47441bed49 ("watchdog: hpe-wdt: Introduce HPE GXP Watchdog")

That is somewhat unfortunate as it will can lead to confusion with
the long standing hpwdt.  These are different watchdogs.

Jerry
> 
> I am fine with both.
>