drm/ast: Rename AST_IO_CRTC_PORT to AST_IO_VGACRI
[linux-block.git] / drivers / leds / leds-turris-omnia.c
index ffcaf228e44a4f9b9ed561f3d40fe5170589175d..b8a95a917cfa49983e1d5e797f0e7a60c5bf5360 100644 (file)
@@ -156,12 +156,9 @@ static ssize_t brightness_show(struct device *dev, struct device_attribute *a,
                               char *buf)
 {
        struct i2c_client *client = to_i2c_client(dev);
-       struct omnia_leds *leds = i2c_get_clientdata(client);
        int ret;
 
-       mutex_lock(&leds->lock);
        ret = i2c_smbus_read_byte_data(client, CMD_LED_GET_BRIGHTNESS);
-       mutex_unlock(&leds->lock);
 
        if (ret < 0)
                return ret;
@@ -173,7 +170,6 @@ static ssize_t brightness_store(struct device *dev, struct device_attribute *a,
                                const char *buf, size_t count)
 {
        struct i2c_client *client = to_i2c_client(dev);
-       struct omnia_leds *leds = i2c_get_clientdata(client);
        unsigned long brightness;
        int ret;
 
@@ -183,15 +179,10 @@ static ssize_t brightness_store(struct device *dev, struct device_attribute *a,
        if (brightness > 100)
                return -EINVAL;
 
-       mutex_lock(&leds->lock);
        ret = i2c_smbus_write_byte_data(client, CMD_LED_SET_BRIGHTNESS,
                                        (u8)brightness);
-       mutex_unlock(&leds->lock);
-
-       if (ret < 0)
-               return ret;
 
-       return count;
+       return ret < 0 ? ret : count;
 }
 static DEVICE_ATTR_RW(brightness);