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: <3b8e5847-6859-d78d-6274-7a879557dcae@ti.com>
Date:   Wed, 17 Jul 2019 15:14:21 +0200
From:   Jean-Jacques Hiblot <jjhiblot@...com>
To:     Dan Murphy <dmurphy@...com>, <jacek.anaszewski@...il.com>,
        <pavel@....cz>, <robh+dt@...nel.org>, <mark.rutland@....com>,
        <daniel.thompson@...aro.org>
CC:     <linux-leds@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <devicetree@...r.kernel.org>
Subject: Re: [PATCH v2 2/2] leds: Add control of the voltage/current regulator
 to the LED core

Hi Dan,

On 15/07/2019 20:59, Dan Murphy wrote:
> JJ
>
> On 7/15/19 10:56 AM, Jean-Jacques Hiblot wrote:
>> A LED is usually powered by a voltage/current regulator. Let the LED 
>> core
>> know about it. This allows the LED core to turn on or off the power 
>> supply
>> as needed.
>
> This allows the LED core to turn on or off managed power supplies.
>
>
>>
>> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@...com>
>> ---

>>       if (led_cdev->flags & LED_BRIGHT_HW_CHANGED) {
>>           ret = led_add_brightness_hw_changed(led_cdev);
>>           if (ret) {
>> diff --git a/drivers/leds/led-core.c b/drivers/leds/led-core.c
>> index 7107cd7e87cf..a12b880b0a2f 100644
>> --- a/drivers/leds/led-core.c
>> +++ b/drivers/leds/led-core.c
>> @@ -23,6 +23,33 @@ EXPORT_SYMBOL_GPL(leds_list_lock);
>>   LIST_HEAD(leds_list);
>>   EXPORT_SYMBOL_GPL(leds_list);
>>   +static bool __led_need_regulator_update(struct led_classdev 
>> *led_cdev,
>> +                    int brightness)
>> +{
>> +    bool new_state = (brightness != LED_OFF);
>> +
>> +    return led_cdev->regulator && led_cdev->regulator_state != 
>> new_state;
>> +}
>> +
>> +static int __led_handle_regulator(struct led_classdev *led_cdev,
>> +                int brightness)
>> +{
>> +    int rc;
>
> Should there be a check for the regulator pointer.
>
> If (!led_cdev->regulator)
>
>     return 0;

Not required because __led_need_regulator_update() returns false if 
led_cdev->regulator is NULL.

Thanks for the review

JJ

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ