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 <krzk@kernel.org> Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
This commit is contained in:
parent
e5a0436dd0
commit
cb14e6d6d8
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue