lkml.org 
[lkml]   [2014]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2] leds: USB: Add support for MSI GT683R led panels
From
> First of all, please reply to the original thread and make sure to not
> drop people or lists from CC.

Sorry this is my first patch and i didn't know that. Now I know.

> For arrays you can use the ARRAY_SIZE() macro if that was the reason for
> this change. I should have mentioned that when I pointed out that you
> cannot use strlen().

That wasn't the reason. I just thought it might be better to use u64
than char[8]. I know why I can't use strlen and that was only careless
error. And there was lot of them :( I will be more careful next time.

> Where did you get these (HID report) values from by the way?

I got them by reverse engineering.

>> +
>> +static void gt683r_brightness_set(struct led_classdev *led_cdev,
>> + enum led_brightness brightness)
>> +{
>> + struct gt683r_led *led =
>> + container_of(led_cdev, struct gt683r_led, led_dev);
>> +
>> + mutex_lock(&led->lock);
>
> You cannot grab a mutex here since this function can be called from
> interrupt context (if I remember correctly). Either way, you shouldn't
> be holding the lock until the work task has finished...

I thought use asked me to put some lock there:

>> +
>> +static void gt683r_brightness_set(struct led_classdev *led_cdev,
>> + enum led_brightness brightness)
>> +{
>> + struct gt683r_led *led =
>> + container_of(led_cdev, struct gt683r_led, led_dev);
>> +
>> + led->brightness = brightness;
>
> Missing locking?

Janne


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