lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20191029104713.tvdeskct2ulvo6pv@earth.universe>
Date:   Tue, 29 Oct 2019 11:47:13 +0100
From:   Sebastian Reichel <sre@...nel.org>
To:     Chris Packham <chris.packham@...iedtelesis.co.nz>
Cc:     linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] power: reset: gpio-restart: don't error on deferral

Hi,

On Tue, Oct 29, 2019 at 01:43:02PM +1300, Chris Packham wrote:
> Don't generate an error message when devm_gpiod_get fails with
> -EPROBE_DEFER.
> 
> Signed-off-by: Chris Packham <chris.packham@...iedtelesis.co.nz>
> ---

Change looks good generally, but please make it like this to reduce
the amount of PTR_ERR():

ret = PTR_ERR_OR_ZERO(gpio_restart->reset_gpio)
if (ret) {
    if (ret != -EPROBE_DEFER)
        dev_err(...)
    return ret;
}

Thanks,

-- Sebastian

>  drivers/power/reset/gpio-restart.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/power/reset/gpio-restart.c b/drivers/power/reset/gpio-restart.c
> index 308ca9d9d276..4aaa46b80ba2 100644
> --- a/drivers/power/reset/gpio-restart.c
> +++ b/drivers/power/reset/gpio-restart.c
> @@ -65,7 +65,8 @@ static int gpio_restart_probe(struct platform_device *pdev)
>  	gpio_restart->reset_gpio = devm_gpiod_get(&pdev->dev, NULL,
>  			open_source ? GPIOD_IN : GPIOD_OUT_LOW);
>  	if (IS_ERR(gpio_restart->reset_gpio)) {
> -		dev_err(&pdev->dev, "Could not get reset GPIO\n");
> +		if (PTR_ERR(gpio_restart->reset_gpio) != -EPROBE_DEFER)
> +			dev_err(&pdev->dev, "Could not get reset GPIO\n");
>  		return PTR_ERR(gpio_restart->reset_gpio);
>  	}
>  
> -- 
> 2.23.0
> 

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ