linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: eichest@gmail.com, linux-watchdog@vger.kernel.org
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: Re: [PATCH v2] watchdog: imx_sc_wdt: fix pretimeout
Date: Tue, 6 Apr 2021 06:41:27 -0700	[thread overview]
Message-ID: <143a39d7-1c4b-e823-e677-a650d1a00443@roeck-us.net> (raw)
In-Reply-To: <20210406121246.49335-1-eichest@gmail.com>

On 4/6/21 5:12 AM, eichest@gmail.com wrote:
> From: Stefan Eichenberger <eichest@gmail.com>
> 
> If the WDIOF_PRETIMEOUT flag is not set when registering the device the
> driver will not show the sysfs entries or register the default governor.
> By moving the registering after the decision whether pretimeout is
> supported this gets fixed.
> 
> Signed-off-by: Stefan Eichenberger <eichest@gmail.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/imx_sc_wdt.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/watchdog/imx_sc_wdt.c b/drivers/watchdog/imx_sc_wdt.c
> index e9ee22a7cb45..8ac021748d16 100644
> --- a/drivers/watchdog/imx_sc_wdt.c
> +++ b/drivers/watchdog/imx_sc_wdt.c
> @@ -183,16 +183,12 @@ static int imx_sc_wdt_probe(struct platform_device *pdev)
>  	watchdog_stop_on_reboot(wdog);
>  	watchdog_stop_on_unregister(wdog);
>  
> -	ret = devm_watchdog_register_device(dev, wdog);
> -	if (ret)
> -		return ret;
> -
>  	ret = imx_scu_irq_group_enable(SC_IRQ_GROUP_WDOG,
>  				       SC_IRQ_WDOG,
>  				       true);
>  	if (ret) {
>  		dev_warn(dev, "Enable irq failed, pretimeout NOT supported\n");
> -		return 0;
> +		goto register_device;
>  	}
>  
>  	imx_sc_wdd->wdt_notifier.notifier_call = imx_sc_wdt_notify;
> @@ -203,7 +199,7 @@ static int imx_sc_wdt_probe(struct platform_device *pdev)
>  					 false);
>  		dev_warn(dev,
>  			 "Register irq notifier failed, pretimeout NOT supported\n");
> -		return 0;
> +		goto register_device;
>  	}
>  
>  	ret = devm_add_action_or_reset(dev, imx_sc_wdt_action,
> @@ -213,7 +209,8 @@ static int imx_sc_wdt_probe(struct platform_device *pdev)
>  	else
>  		dev_warn(dev, "Add action failed, pretimeout NOT supported\n");
>  
> -	return 0;
> +register_device:
> +	return devm_watchdog_register_device(dev, wdog);
>  }
>  
>  static int __maybe_unused imx_sc_wdt_suspend(struct device *dev)
> 


      reply	other threads:[~2021-04-06 13:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-06 12:12 [PATCH v2] watchdog: imx_sc_wdt: fix pretimeout eichest
2021-04-06 13:41 ` Guenter Roeck [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=143a39d7-1c4b-e823-e677-a650d1a00443@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=a.fatoum@pengutronix.de \
    --cc=eichest@gmail.com \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-imx@nxp.com \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=wim@linux-watchdog.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).