lkml.org 
[lkml]   [2015]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH/RFC v3 1/7] leds: Add led_set_brightness_sync to the public LED subsystem API
On 07/05/2015 02:34 PM, Pavel Machek wrote:
> Hi!
>
>> extern void led_set_brightness(struct led_classdev *led_cdev,
>> enum led_brightness brightness);
>> +
>> +/**
>> + * led_set_brightness_sync - set LED brightness synchronously
>> + * @led_cdev: the LED to set
>> + * @brightness: the brightness to set it to
>> + *
>> + * Set an LED's brightness immediately. This function will block
>> + * the caller for the time required for accessing device register,
>> + * and it can sleep.
>> + */
>> +static inline int led_set_brightness_sync(struct led_classdev *led_cdev,
>> + enum led_brightness value)
>> +{
>> + int ret = 0;
>> +
>> + led_cdev->brightness = min(value, led_cdev->max_brightness);
>> +
>> + if (led_cdev->flags & LED_SUSPENDED)
>> + return 0;
>> +
>> + if (led_cdev->brightness_set_sync)
>> + ret = led_cdev->brightness_set_sync(led_cdev,
>> + led_cdev->brightness);
>> + else
>> + led_cdev->brightness_set(led_cdev, led_cdev->brightness);
>> +
>> + return 0;
>> +}
>
> return ret, AFAICT?

Right, thanks.

--
Best Regards,
Jacek Anaszewski


\
 
 \ /
  Last update: 2015-07-06 08:41    [W:0.095 / U:0.660 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site