diff options
author | Dan Murphy <dmurphy@ti.com> | 2020-07-16 20:20:00 +0200 |
---|---|---|
committer | Pavel Machek <pavel@ucw.cz> | 2020-07-22 14:42:06 +0200 |
commit | c732eaf01f9c213d34b2d224bcda830089bbcf8a (patch) | |
tree | 4d1a1670b2d4ad32bb5678f1b1e17bc0ad1d47ce /drivers/leds/leds-lp55xx-common.c | |
parent | dt-bindings: leds: Convert leds-lp55xx to yaml (diff) | |
download | linux-c732eaf01f9c213d34b2d224bcda830089bbcf8a.tar.xz linux-c732eaf01f9c213d34b2d224bcda830089bbcf8a.zip |
leds: lp55xx: Convert LED class registration to devm_*
Convert the LED class registration calls to the LED devm_*
registration calls.
Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Diffstat (limited to 'drivers/leds/leds-lp55xx-common.c')
-rw-r--r-- | drivers/leds/leds-lp55xx-common.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/drivers/leds/leds-lp55xx-common.c b/drivers/leds/leds-lp55xx-common.c index 3d0bc4dcd9f2..243c749ebda5 100644 --- a/drivers/leds/leds-lp55xx-common.c +++ b/drivers/leds/leds-lp55xx-common.c @@ -179,7 +179,7 @@ static int lp55xx_init_led(struct lp55xx_led *led, led->cdev.name = name; } - ret = led_classdev_register(dev, &led->cdev); + ret = devm_led_classdev_register(dev, &led->cdev); if (ret) { dev_err(dev, "led register err: %d\n", ret); return ret; @@ -480,23 +480,10 @@ int lp55xx_register_leds(struct lp55xx_led *led, struct lp55xx_chip *chip) return 0; err_init_led: - lp55xx_unregister_leds(led, chip); return ret; } EXPORT_SYMBOL_GPL(lp55xx_register_leds); -void lp55xx_unregister_leds(struct lp55xx_led *led, struct lp55xx_chip *chip) -{ - int i; - struct lp55xx_led *each; - - for (i = 0; i < chip->num_leds; i++) { - each = led + i; - led_classdev_unregister(&each->cdev); - } -} -EXPORT_SYMBOL_GPL(lp55xx_unregister_leds); - int lp55xx_register_sysfs(struct lp55xx_chip *chip) { struct device *dev = &chip->cl->dev; |