diff options
author | Andrew Lunn <andrew@lunn.ch> | 2015-08-20 12:22:57 +0200 |
---|---|---|
committer | Jacek Anaszewski <j.anaszewski@samsung.com> | 2016-01-04 09:57:33 +0100 |
commit | 95b2af637e283e3d549c8a6af9f182b0bd972a2e (patch) | |
tree | ab1d6e73c0a060faa36dda71b66ab0b9cd829e8e /drivers/leds/leds-lp55xx-common.c | |
parent | 525d6a65a2abe279889b019e2663b8a11bc4f90b (diff) |
leds: lp55xx: Remove work queue
Now the core implements the work queue, remove it from the drivers,
and switch to using brightness_set_blocking op.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Cc: Milo Kim <milo.kim@ti.com>
Diffstat (limited to 'drivers/leds/leds-lp55xx-common.c')
-rw-r--r-- | drivers/leds/leds-lp55xx-common.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/leds/leds-lp55xx-common.c b/drivers/leds/leds-lp55xx-common.c index 59b76833f0d3..5377f22ff994 100644 --- a/drivers/leds/leds-lp55xx-common.c +++ b/drivers/leds/leds-lp55xx-common.c @@ -134,13 +134,14 @@ static struct attribute *lp55xx_led_attrs[] = { }; ATTRIBUTE_GROUPS(lp55xx_led); -static void lp55xx_set_brightness(struct led_classdev *cdev, +static int lp55xx_set_brightness(struct led_classdev *cdev, enum led_brightness brightness) { struct lp55xx_led *led = cdev_to_lp55xx_led(cdev); + struct lp55xx_device_config *cfg = led->chip->cfg; led->brightness = (u8)brightness; - schedule_work(&led->brightness_work); + return cfg->brightness_fn(led); } static int lp55xx_init_led(struct lp55xx_led *led, @@ -172,7 +173,7 @@ static int lp55xx_init_led(struct lp55xx_led *led, return -EINVAL; } - led->cdev.brightness_set = lp55xx_set_brightness; + led->cdev.brightness_set_blocking = lp55xx_set_brightness; led->cdev.groups = lp55xx_led_groups; if (pdata->led_config[chan].name) { @@ -464,7 +465,7 @@ int lp55xx_register_leds(struct lp55xx_led *led, struct lp55xx_chip *chip) int ret; int i; - if (!cfg->brightness_work_fn) { + if (!cfg->brightness_fn) { dev_err(&chip->cl->dev, "empty brightness configuration\n"); return -EINVAL; } @@ -481,8 +482,6 @@ int lp55xx_register_leds(struct lp55xx_led *led, struct lp55xx_chip *chip) if (ret) goto err_init_led; - INIT_WORK(&each->brightness_work, cfg->brightness_work_fn); - chip->num_leds++; each->chip = chip; @@ -507,7 +506,6 @@ void lp55xx_unregister_leds(struct lp55xx_led *led, struct lp55xx_chip *chip) for (i = 0; i < chip->num_leds; i++) { each = led + i; led_classdev_unregister(&each->cdev); - flush_work(&each->brightness_work); } } EXPORT_SYMBOL_GPL(lp55xx_unregister_leds); |