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] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 12 Jul 2019 15:52:36 +0200
From:   Jean-Jacques Hiblot <jjhiblot@...com>
To:     Pavel Machek <pavel@....cz>
CC:     <jacek.anaszewski@...il.com>, <robh+dt@...nel.org>,
        <mark.rutland@....com>, <lee.jones@...aro.org>,
        <daniel.thompson@...aro.org>, <jingoohan1@...il.com>,
        <dmurphy@...com>, <linux-leds@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <dri-devel@...ts.freedesktop.org>,
        <tomi.valkeinen@...com>
Subject: Re: [PATCH v3 1/4] leds: Add of_led_get() and led_put()

hi Pavel

On 10/07/2019 21:09, Pavel Machek wrote:
> On Wed 2019-07-10 14:39:29, Jean-Jacques Hiblot wrote:
>> From: Tomi Valkeinen <tomi.valkeinen@...com>
>>
>> This patch adds basic support for a kernel driver to get a LED device.
>> This will be used by the led-backlight driver.
>>
>> Only OF version is implemented for now, and the behavior is similar to
>> PWM's of_pwm_get() and pwm_put().
>>
>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@...com>
>> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@...com>
>>
>>
>> @@ -214,6 +215,55 @@ static int led_resume(struct device *dev)
>>   
>>   static SIMPLE_DEV_PM_OPS(leds_class_dev_pm_ops, led_suspend, led_resume);
>>   
>> +static int led_match_led_node(struct device *led_dev, const void *data)
>> +{
>> +	return led_dev->of_node == data ? 1 : 0;
>> +}
> Get rid of the "? 1 : 0"?
OK
>
>
>> +	led_node = of_parse_phandle(np, "leds", index);
>> +	if (!led_node)
>> +		return ERR_PTR(-ENOENT);
>> +	led_dev = class_find_device(leds_class, NULL, led_node,
>> +		led_match_led_node);
>> +	of_node_put(led_node);
>> +
>> +	if (!led_dev)
>> +		return ERR_PTR(-EPROBE_DEFER);
> Won't this defer probe "forever" when the driver is not available?

Yes it will.

However I don't see how we can fix this because we don't know for sure 
that the LED driver will not become available at a later time.

JJ



>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ