[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190913125230.GA18629@roeck-us.net>
Date: Fri, 13 Sep 2019 05:52:30 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@...aro.org>
Cc: wim@...ux-watchdog.org, linux-watchdog@...r.kernel.org,
linux-kernel@...r.kernel.org, bjorn.andersson@...aro.org
Subject: Re: [PATCH 1/2] watchdog: pm8916_wdt: fix pretimeout registration
flow
On Fri, Sep 06, 2019 at 10:30:53PM +0200, Jorge Ramirez-Ortiz wrote:
> When an IRQ is present in the dts, the probe function shall fail if
> the interrupt can not be registered.
>
> The probe function shall also be retried if getting the irq is being
> deferred.
>
> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@...aro.org>
> Reviewed-by: Loic Poulain <loic.poulain@...aro.org>
Reviewed-by: Guenter Roeck <linux@...ck-us.net>
with nitpick below.
> ---
> drivers/watchdog/pm8916_wdt.c | 16 ++++++++++++----
> 1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/watchdog/pm8916_wdt.c b/drivers/watchdog/pm8916_wdt.c
> index 2d3652004e39..cb5304c26ac3 100644
> --- a/drivers/watchdog/pm8916_wdt.c
> +++ b/drivers/watchdog/pm8916_wdt.c
> @@ -163,9 +163,18 @@ static int pm8916_wdt_probe(struct platform_device *pdev)
>
> irq = platform_get_irq(pdev, 0);
> if (irq > 0) {
> - if (devm_request_irq(dev, irq, pm8916_wdt_isr, 0, "pm8916_wdt",
> - wdt))
> - irq = 0;
> + err = devm_request_irq(dev, irq, pm8916_wdt_isr, 0,
> + "pm8916_wdt", wdt);
> + if (err)
> + return err;
> +
> + wdt->wdev.info = &pm8916_wdt_pt_ident;
> +
Unnecessary empty line.
> + } else {
> + if (irq == -EPROBE_DEFER)
> + return -EPROBE_DEFER;
> +
> + wdt->wdev.info = &pm8916_wdt_ident;
> }
>
> /* Configure watchdog to hard-reset mode */
> @@ -177,7 +186,6 @@ static int pm8916_wdt_probe(struct platform_device *pdev)
> return err;
> }
>
> - wdt->wdev.info = (irq > 0) ? &pm8916_wdt_pt_ident : &pm8916_wdt_ident,
> wdt->wdev.ops = &pm8916_wdt_ops,
> wdt->wdev.parent = dev;
> wdt->wdev.min_timeout = PM8916_WDT_MIN_TIMEOUT;
Powered by blists - more mailing lists