From cb14e6d6d8f411b7a05f36d1f877450c036d8c56 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Fri, 7 Dec 2018 13:32:52 +0100 Subject: leds: pwm: Use OF variant of LED registering function The PWM leds can be instantiated from Device Tree so pass the respective device node to LED core. This provides the LED system with proper device node and exposes it through uevent. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Jacek Anaszewski --- drivers/leds/leds-pwm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c index fcb3e87a9887..af08bcdc4fd8 100644 --- a/drivers/leds/leds-pwm.c +++ b/drivers/leds/leds-pwm.c @@ -114,7 +114,7 @@ static int led_pwm_add(struct device *dev, struct led_pwm_priv *priv, if (!led_data->period && (led->pwm_period_ns > 0)) led_data->period = led->pwm_period_ns; - ret = devm_led_classdev_register(dev, &led_data->cdev); + ret = devm_of_led_classdev_register(dev, child, &led_data->cdev); if (ret == 0) { priv->num_leds++; led_pwm_set(&led_data->cdev, led_data->cdev.brightness); -- cgit v1.2.3