lkml.org 
[lkml]   [2019]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH 5/5] leds: multicolor: Introduce a multicolor class definition
From
Date
Marek

On 4/2/19 12:44 AM, Marek Behun wrote:
> Hi Dan,
>
> On Mon, 1 Apr 2019 12:34:00 -0500
> Dan Murphy <dmurphy@ti.com> wrote:
>
>> +static ssize_t sync_store(struct device *dev,
>> + struct device_attribute *sync_attr,
>> + const char *buf, size_t size)
>> +{
>> + struct led_classdev_mc_data *data = container_of(sync_attr,
>> + struct led_classdev_mc_data,
>> + sync_attr);
>> + struct led_classdev_mc *mcled_cdev = data->mcled_cdev;
>> + struct led_classdev *led_cdev = &mcled_cdev->led_cdev;
>> + const struct led_multicolor_ops *ops = mcled_cdev->ops;
>> + struct led_classdev_mc_priv *priv;
>> + unsigned long sync_value;
>> + ssize_t ret = -EINVAL;
>> +
>> + mutex_lock(&led_cdev->led_access);
>> +
>> + if (!mcled_cdev->sync_enabled)
>> + goto unlock;
>
> This lock is redundant, you could just put
> if (mcled_cdev->sync_enabled)
> return ret;
> before the lock.
>

Ack

Thanks the code is just proof of concept code. But I will make this change as well.

Dan

--
------------------
Dan Murphy

\
 
 \ /
  Last update: 2019-04-02 13:56    [W:0.041 / U:0.660 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site