1 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
2 Date: Mon, 6 Mar 2017 06:19:45 +0100
3 Subject: [PATCH] leds: gpio: use OF variant of LED registering function
5 Content-Type: text/plain; charset=UTF-8
6 Content-Transfer-Encoding: 8bit
8 In leds-gpio we support LEDs specified in DT so we should use
9 (devm_)of_led_classdev_register. This allows passing DT node as argument
10 for use by the LED subsystem.
12 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
13 Acked-by: Pavel Machek <pavel@ucw.cz>
14 Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
16 drivers/leds/leds-gpio.c | 12 ++++++------
17 1 file changed, 6 insertions(+), 6 deletions(-)
19 --- a/drivers/leds/leds-gpio.c
20 +++ b/drivers/leds/leds-gpio.c
21 @@ -77,7 +77,7 @@ static int gpio_blink_set(struct led_cla
23 static int create_gpio_led(const struct gpio_led *template,
24 struct gpio_led_data *led_dat, struct device *parent,
25 - gpio_blink_set_t blink_set)
26 + struct device_node *np, gpio_blink_set_t blink_set)
30 @@ -139,7 +139,7 @@ static int create_gpio_led(const struct
34 - return devm_led_classdev_register(parent, &led_dat->cdev);
35 + return devm_of_led_classdev_register(parent, np, &led_dat->cdev);
38 struct gpio_leds_priv {
39 @@ -206,7 +206,7 @@ static struct gpio_leds_priv *gpio_leds_
40 if (fwnode_property_present(child, "panic-indicator"))
41 led.panic_indicator = 1;
43 - ret = create_gpio_led(&led, led_dat, dev, NULL);
44 + ret = create_gpio_led(&led, led_dat, dev, np, NULL);
46 fwnode_handle_put(child);
48 @@ -240,9 +240,9 @@ static int gpio_led_probe(struct platfor
50 priv->num_leds = pdata->num_leds;
51 for (i = 0; i < priv->num_leds; i++) {
52 - ret = create_gpio_led(&pdata->leds[i],
54 - &pdev->dev, pdata->gpio_blink_set);
55 + ret = create_gpio_led(&pdata->leds[i], &priv->leds[i],
57 + pdata->gpio_blink_set);