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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c1073a35-adaa-1a9b-e1d6-1b36ee7ac1a5@ti.com>
Date:   Mon, 23 Sep 2019 09:17:39 -0500
From:   Dan Murphy <dmurphy@...com>
To:     Guido Günther <agx@...xcpu.org>,
        Jacek Anaszewski <jacek.anaszewski@...il.com>,
        Pavel Machek <pavel@....cz>, <linux-leds@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 3/5] leds: lm3692x: Handle failure to probe the
 regulator

Guido

Thanks for the update

Reviewed-by: Dan Murphy <dmurphy@...com>

On 9/21/19 4:12 PM, Guido Günther wrote:
> Instead use devm_regulator_get_optional since the regulator
> is optional and check for errors.
>
> Signed-off-by: Guido Günther <agx@...xcpu.org>
> Acked-by: Pavel Machek <pavel@....cz>
> ---
>   drivers/leds/leds-lm3692x.c | 13 +++++++++++--
>   1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/leds/leds-lm3692x.c b/drivers/leds/leds-lm3692x.c
> index ad76e34455ff..54e9bd2d288b 100644
> --- a/drivers/leds/leds-lm3692x.c
> +++ b/drivers/leds/leds-lm3692x.c
> @@ -337,9 +337,18 @@ static int lm3692x_probe_dt(struct lm3692x_led *led)
>   		return ret;
>   	}
>   
> -	led->regulator = devm_regulator_get(&led->client->dev, "vled");
> -	if (IS_ERR(led->regulator))
> +	led->regulator = devm_regulator_get_optional(&led->client->dev, "vled");
> +	if (IS_ERR(led->regulator)) {
> +		ret = PTR_ERR(led->regulator);
> +		if (ret != -ENODEV) {
> +			if (ret != -EPROBE_DEFER)
> +				dev_err(&led->client->dev,
> +					"Failed to get vled regulator: %d\n",
> +					ret);
> +			return ret;
> +		}
>   		led->regulator = NULL;
> +	}
>   
>   	child = device_get_next_child_node(&led->client->dev, child);
>   	if (!child) {

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ