Linux-Watchdog Archive on lore.kernel.org
 help / color / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
Cc: wim@linux-watchdog.org, linux-watchdog@vger.kernel.org,
	linux-kernel@vger.kernel.org, bjorn.andersson@linaro.org
Subject: Re: [PATCH 1/2] watchdog: pm8916_wdt: fix pretimeout registration flow
Date: Fri, 13 Sep 2019 05:52:30 -0700
Message-ID: <20190913125230.GA18629@roeck-us.net> (raw)
In-Reply-To: <20190906203054.26725-1-jorge.ramirez-ortiz@linaro.org>

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@linaro.org>
> Reviewed-by: Loic Poulain <loic.poulain@linaro.org>

Reviewed-by: Guenter Roeck <linux@roeck-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;

      parent reply index

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-06 20:30 Jorge Ramirez-Ortiz
2019-09-06 20:30 ` [PATCH 2/2] watchdog: pm8916_wdt: fix missing include Jorge Ramirez-Ortiz
2019-09-08 22:54   ` Guenter Roeck
2019-09-08 22:50 ` [PATCH 1/2] watchdog: pm8916_wdt: fix pretimeout registration flow Guenter Roeck
     [not found]   ` <CAMZdPi-P_AopbbyJEWDbnm7X8MtxTzs=MN13+UFndL2OK5VReg@mail.gmail.com>
2019-09-11 17:54     ` Guenter Roeck
2019-09-13 10:36       ` Loic Poulain
2019-09-13 12:52 ` Guenter Roeck [this message]

Reply instructions:

You may reply publically 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=20190913125230.GA18629@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=bjorn.andersson@linaro.org \
    --cc=jorge.ramirez-ortiz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.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

Linux-Watchdog Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-watchdog/0 linux-watchdog/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-watchdog linux-watchdog/ https://lore.kernel.org/linux-watchdog \
		linux-watchdog@vger.kernel.org linux-watchdog@archiver.kernel.org
	public-inbox-index linux-watchdog


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-watchdog


AGPL code for this site: git clone https://public-inbox.org/ public-inbox