ptp: switch to use gpiolib
authorLinus Walleij <linus.walleij@linaro.org>
Tue, 10 Sep 2013 11:15:18 +0000 (13:15 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 27 Sep 2013 12:15:27 +0000 (14:15 +0200)
This platform supports gpiolib, so remove the custom API use
and replace with calls to gpiolib. Also request the GPIO before
starting to use it.

Cc: Imre Kaloz <kaloz@openwrt.org>
Cc: Alexandre Courbot <acourbot@nvidia.com>
Cc: netdev@vger.kernel.org
Acked-by: Richard Cochran <richardcochran@gmail.com>
Acked-by: Krzysztof Halasa <khc@pm.waw.pl>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/ptp/ptp_ixp46x.c

index d49b85164fd22e830f51e066337801134eef9354..4a08727fcaf39b55f409c005863603215c9b27cb 100644 (file)
@@ -259,8 +259,15 @@ static struct ixp_clock ixp_clock;
 static int setup_interrupt(int gpio)
 {
        int irq;
+       int err;
 
-       gpio_line_config(gpio, IXP4XX_GPIO_IN);
+       err = gpio_request(gpio, "ixp4-ptp");
+       if (err)
+               return err;
+
+       err = gpio_direction_input(gpio);
+       if (err)
+               return err;
 
        irq = gpio_to_irq(gpio);