@@ -65,6 +65,7 @@ static int led_pwm_add(struct device *dev, struct led_pwm_priv *priv,
struct led_pwm *led, struct fwnode_handle *fwnode)
{
struct led_pwm_data *led_data = &priv->leds[priv->num_leds];
+ struct led_init_data init_data = {};
int ret;
led_data->active_low = led->active_low;
@@ -90,7 +91,13 @@ static int led_pwm_add(struct device *dev, struct led_pwm_priv *priv,
pwm_init_state(led_data->pwm, &led_data->pwmstate);
- ret = devm_led_classdev_register(dev, &led_data->cdev);
+ if (fwnode) {
+ init_data.fwnode = fwnode;
+ ret = devm_led_classdev_register_ext(dev, &led_data->cdev,
+ &init_data);
+ } else {
+ ret = devm_led_classdev_register(dev, &led_data->cdev);
+ }
if (ret) {
dev_err(dev, "failed to register PWM led for %s: %d\n",
led->name, ret);