From: AnilKumar Ch Date: Sat, 1 Sep 2012 08:16:30 +0000 (+0800) Subject: leds: leds-gpio: adopt pinctrl support X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8fe4554f;p=linux-beck.git leds: leds-gpio: adopt pinctrl support Adopt pinctrl support to leds-gpio driver based on leds-gpio device pointer, pinctrl driver configure SoC pins to GPIO mode according to definitions provided in .dts file. Signed-off-by: AnilKumar Ch Acked-by: Marek Vasut Reviewed-by: Linus Walleij Signed-off-by: Bryan Wu --- diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c index cde85ba1903a..087d1e66f4f7 100644 --- a/drivers/leds/leds-gpio.c +++ b/drivers/leds/leds-gpio.c @@ -20,6 +20,7 @@ #include #include #include +#include struct gpio_led_data { struct led_classdev cdev; @@ -234,8 +235,14 @@ static int __devinit gpio_led_probe(struct platform_device *pdev) { struct gpio_led_platform_data *pdata = pdev->dev.platform_data; struct gpio_leds_priv *priv; + struct pinctrl *pinctrl; int i, ret = 0; + pinctrl = devm_pinctrl_get_select_default(&pdev->dev); + if (IS_ERR(pinctrl)) + dev_warn(&pdev->dev, + "pins are not configured from the driver\n"); + if (pdata && pdata->num_leds) { priv = devm_kzalloc(&pdev->dev, sizeof_gpio_leds_priv(pdata->num_leds),