lkml.org 
[lkml]   [2015]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/5] leds: core: Add an internal led_set_brightness_nosleep function
On 09/22/2015 09:02 PM, Andrew Lunn wrote:
>> +void led_set_brightness_nosleep(struct led_classdev *led_cdev,
>> + enum led_brightness value)
>> +{
>> + led_cdev->brightness = min(value, led_cdev->max_brightness);
>> +
>> + if (led_cdev->flags & LED_SUSPENDED)
>> + return;
>> +
>> + /* Use brightness_set op if available, it is guaranteed not to sleep */
>> + if (led_cdev->brightness_set)
>> + led_cdev->brightness_set(led_cdev, led_cdev->brightness);
>> +
>> + /* If brightness setting can sleep, delegate it to a work queue task */
>> + led_cdev->delayed_set_value = led_cdev->brightness;
>> + schedule_work(&led_cdev->set_brightness_work);
>> +}
>
> To me, it looks like there is a missing else, or return here. We don't
> want both led_cdev->brightness_set() and the work queue.

Thanks for spotting this.

>> +EXPORT_SYMBOL(led_set_brightness_nosleep);
>
> There seems to be a mixture of EXPORT_SYMBOL and
> EXPORT_SYMBOL_GPL. Have you figured out the pattern? led-class.c seems
> to be all _GPL, but led-core.c has a mixture.

In fact, this is weird. I didn't pay sufficient attention to this,
I must admit. We should switch to using EXPORT_SYMBOL_GPL consequently [1].

[1] https://lwn.net/Articles/603187/

--
Best Regards,
Jacek Anaszewski


\
 
 \ /
  Last update: 2015-09-23 11:01    [W:0.108 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site