diff options
Diffstat (limited to 'drivers/leds/leds-aw2013.c')
-rw-r--r-- | drivers/leds/leds-aw2013.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/leds/leds-aw2013.c b/drivers/leds/leds-aw2013.c index d709cc1f949e..80d937454aee 100644 --- a/drivers/leds/leds-aw2013.c +++ b/drivers/leds/leds-aw2013.c @@ -261,11 +261,11 @@ out: static int aw2013_probe_dt(struct aw2013 *chip) { - struct device_node *np = chip->client->dev.of_node, *child; + struct device_node *np = dev_of_node(&chip->client->dev), *child; int count, ret = 0, i = 0; struct aw2013_led *led; - count = of_get_child_count(np); + count = of_get_available_child_count(np); if (!count || count > AW2013_MAX_LEDS) return -EINVAL; @@ -297,16 +297,15 @@ static int aw2013_probe_dt(struct aw2013 *chip) "DT property led-max-microamp is missing\n"); } - of_property_read_string(child, "linux,default-trigger", - &led->cdev.default_trigger); - led->cdev.brightness_set_blocking = aw2013_brightness_set; led->cdev.blink_set = aw2013_blink_set; ret = devm_led_classdev_register_ext(&chip->client->dev, &led->cdev, &init_data); - if (ret < 0) + if (ret < 0) { + of_node_put(child); return ret; + } i++; } |