All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacek Anaszewski <j.anaszewski@samsung.com>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: linux-leds@vger.kernel.org
Subject: Re: [PATCH v2 2/4] leds: core: add color LED sysfs extension
Date: Wed, 17 Feb 2016 13:43:27 +0100	[thread overview]
Message-ID: <56C46AEF.8060507@samsung.com> (raw)
In-Reply-To: <56C468AB.509@samsung.com>

On 02/17/2016 01:33 PM, Jacek Anaszewski wrote:
> Hi Heiner,
>
> On 02/16/2016 08:28 PM, Heiner Kallweit wrote:
>> Extend brightness sysfs property handling to deal with monochrome
>> and color mode as well.
>>
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>> ---
>> v2:
>> - split from patch 1
>> ---
>>   drivers/leds/led-class.c | 9 ++++++---
>>   1 file changed, 6 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
>> index aa84e5b..09e0007 100644
>> --- a/drivers/leds/led-class.c
>> +++ b/drivers/leds/led-class.c
>> @@ -32,7 +32,10 @@ static ssize_t brightness_show(struct device *dev,
>>       /* no lock needed for this */
>>       led_update_brightness(led_cdev);
>>
>> -    return sprintf(buf, "%u\n", led_cdev->brightness);
>> +    if (led_cdev->brightness > LED_FULL)
>> +        return sprintf(buf, "%#06x\n", led_cdev->brightness);
>> +    else
>> +        return sprintf(buf, "%u\n", led_cdev->brightness);
>>   }

This change also should remain here.

>>   static ssize_t brightness_store(struct device *dev,
>> @@ -49,11 +52,11 @@ static ssize_t brightness_store(struct device *dev,
>>           goto unlock;
>>       }
>>
>> -    ret = kstrtoul(buf, 10, &state);
>> +    ret = kstrtoul(buf, 0, &state);
>>       if (ret)
>>           goto unlock;
>
> Please leave only this change in the patch, as it extends the scope
> of possible arguments for user space. Remaining changes can be moved
> to 1/4.
>
>
>>
>> -    if (state == LED_OFF)
>> +    if (is_off(state))

Only this should go to 1/4.

>>           led_trigger_remove(led_cdev);
>>       led_set_brightness(led_cdev, state);
>>
>>
>
>


-- 
Best regards,
Jacek Anaszewski

      reply	other threads:[~2016-02-17 12:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-16 19:28 [PATCH v2 2/4] leds: core: add color LED sysfs extension Heiner Kallweit
2016-02-17 12:33 ` Jacek Anaszewski
2016-02-17 12:43   ` Jacek Anaszewski [this message]

Reply instructions:

You may reply publicly 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=56C46AEF.8060507@samsung.com \
    --to=j.anaszewski@samsung.com \
    --cc=hkallweit1@gmail.com \
    --cc=linux-leds@vger.kernel.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.