diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-03-25 03:53:42 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-03-25 03:53:42 -0300 |
commit | 03dd4cb26d967f9588437b0fc9cc0e8353322bb7 (patch) | |
tree | fa581f6dc1c0596391690d1f67eceef3af8246dc /drivers/leds/leds-lp5562.c | |
parent | d4e493caf788ef44982e131ff9c786546904d934 (diff) |
Linux-libre 4.5-gnu
Diffstat (limited to 'drivers/leds/leds-lp5562.c')
-rw-r--r-- | drivers/leds/leds-lp5562.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/leds/leds-lp5562.c b/drivers/leds/leds-lp5562.c index 0360c59db..b75333803 100644 --- a/drivers/leds/leds-lp5562.c +++ b/drivers/leds/leds-lp5562.c @@ -311,10 +311,8 @@ static int lp5562_post_init_device(struct lp55xx_chip *chip) return 0; } -static void lp5562_led_brightness_work(struct work_struct *work) +static int lp5562_led_brightness(struct lp55xx_led *led) { - struct lp55xx_led *led = container_of(work, struct lp55xx_led, - brightness_work); struct lp55xx_chip *chip = led->chip; u8 addr[] = { LP5562_REG_R_PWM, @@ -322,10 +320,13 @@ static void lp5562_led_brightness_work(struct work_struct *work) LP5562_REG_B_PWM, LP5562_REG_W_PWM, }; + int ret; mutex_lock(&chip->lock); - lp55xx_write(chip, addr[led->chan_nr], led->brightness); + ret = lp55xx_write(chip, addr[led->chan_nr], led->brightness); mutex_unlock(&chip->lock); + + return ret; } static void lp5562_write_program_memory(struct lp55xx_chip *chip, @@ -503,7 +504,7 @@ static struct lp55xx_device_config lp5562_cfg = { }, .post_init_device = lp5562_post_init_device, .set_led_current = lp5562_set_led_current, - .brightness_work_fn = lp5562_led_brightness_work, + .brightness_fn = lp5562_led_brightness, .run_engine = lp5562_run_engine, .firmware_cb = lp5562_firmware_loaded, .dev_attr_group = &lp5562_group, |