Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
[firefly-linux-kernel-4.4.55.git] / drivers / gpio / gpio-pl061.c
index e15499936c1824e29f72eaad100f2af22efdff8e..4d4b3767670220a03076301ced6b3b12cffcd265 100644 (file)
@@ -52,36 +52,12 @@ struct pl061_gpio {
 
        void __iomem            *base;
        struct gpio_chip        gc;
-       bool                    uses_pinctrl;
 
 #ifdef CONFIG_PM
        struct pl061_context_save_regs csave_regs;
 #endif
 };
 
-static int pl061_gpio_request(struct gpio_chip *gc, unsigned offset)
-{
-       /*
-        * Map back to global GPIO space and request muxing, the direction
-        * parameter does not matter for this controller.
-        */
-       struct pl061_gpio *chip = container_of(gc, struct pl061_gpio, gc);
-       int gpio = gc->base + offset;
-
-       if (chip->uses_pinctrl)
-               return pinctrl_request_gpio(gpio);
-       return 0;
-}
-
-static void pl061_gpio_free(struct gpio_chip *gc, unsigned offset)
-{
-       struct pl061_gpio *chip = container_of(gc, struct pl061_gpio, gc);
-       int gpio = gc->base + offset;
-
-       if (chip->uses_pinctrl)
-               pinctrl_free_gpio(gpio);
-}
-
 static int pl061_direction_input(struct gpio_chip *gc, unsigned offset)
 {
        struct pl061_gpio *chip = container_of(gc, struct pl061_gpio, gc);
@@ -329,11 +305,11 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id)
                return PTR_ERR(chip->base);
 
        spin_lock_init(&chip->lock);
-       if (of_property_read_bool(dev->of_node, "gpio-ranges"))
-               chip->uses_pinctrl = true;
+       if (of_property_read_bool(dev->of_node, "gpio-ranges")) {
+               chip->gc.request = gpiochip_generic_request;
+               chip->gc.free = gpiochip_generic_free;
+       }
 
-       chip->gc.request = pl061_gpio_request;
-       chip->gc.free = pl061_gpio_free;
        chip->gc.direction_input = pl061_direction_input;
        chip->gc.direction_output = pl061_direction_output;
        chip->gc.get = pl061_get_value;