w1-gpio: Pinctrl-fy
authorPantelis Antoniou <panto@antoniou-consulting.com>
Wed, 21 Nov 2012 21:13:29 +0000 (01:13 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Nov 2012 00:16:25 +0000 (16:16 -0800)
Enable pinctrl for w1-gpio.

Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
Signed-off-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/w1/masters/w1-gpio.c

index 6012c4ea3206ac58e5d8c0efc561859b10c4b4b1..aec35bd465064365f15157654c1ea9801bb4e927 100644 (file)
@@ -16,6 +16,8 @@
 #include <linux/gpio.h>
 #include <linux/of_platform.h>
 #include <linux/of_gpio.h>
+#include <linux/pinctrl/consumer.h>
+#include <linux/err.h>
 
 #include "../w1.h"
 #include "../w1_int.h"
@@ -85,8 +87,13 @@ static int __init w1_gpio_probe(struct platform_device *pdev)
 {
        struct w1_bus_master *master;
        struct w1_gpio_platform_data *pdata;
+       struct pinctrl *pinctrl;
        int err;
 
+       pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+       if (IS_ERR(pinctrl))
+               dev_warn(&pdev->dev, "unable to select pin group\n");
+
        err = w1_gpio_probe_dt(pdev);
        if (err < 0)
                return err;