pinctrl: sh-pfc: Get rid of CONFIG_ARCH_SHMOBILE_LEGACY
authorGeert Uytterhoeven <geert+renesas@glider.be>
Thu, 27 Aug 2015 20:07:23 +0000 (22:07 +0200)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Fri, 2 Oct 2015 07:54:34 +0000 (09:54 +0200)
Shmobile is all multiplatform these days, so get rid of the reference to
CONFIG_ARCH_SHMOBILE_LEGACY.

Move the legacy code to do the non-DT mapping between GPIOs and pins
inside the existing #ifdef CONFIG_SUPERH section.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/sh-pfc/gpio.c

index 685b3c24627daf03e6f049dc0a9e38ffa74419ff..a917c62f07124b0be3d5ecd378e987f886f76db3 100644 (file)
@@ -341,7 +341,6 @@ int sh_pfc_register_gpiochip(struct sh_pfc *pfc)
        struct sh_pfc_chip *chip;
        phys_addr_t address;
        unsigned int i;
-       int ret;
 
        if (pfc->info->data_regs == NULL)
                return 0;
@@ -379,29 +378,27 @@ int sh_pfc_register_gpiochip(struct sh_pfc *pfc)
        if (IS_ENABLED(CONFIG_OF) && pfc->dev->of_node)
                return 0;
 
-       if (IS_ENABLED(CONFIG_SUPERH) ||
-           IS_ENABLED(CONFIG_ARCH_SHMOBILE_LEGACY)) {
-               /*
-                * Register the GPIO to pin mappings. As pins with GPIO ports
-                * must come first in the ranges, skip the pins without GPIO
-                * ports by stopping at the first range that contains such a
-                * pin.
-                */
-               for (i = 0; i < pfc->nr_ranges; ++i) {
-                       const struct sh_pfc_pin_range *range = &pfc->ranges[i];
-
-                       if (range->start >= pfc->nr_gpio_pins)
-                               break;
-
-                       ret = gpiochip_add_pin_range(&chip->gpio_chip,
-                               dev_name(pfc->dev), range->start, range->start,
-                               range->end - range->start + 1);
-                       if (ret < 0)
-                               return ret;
-               }
+#ifdef CONFIG_SUPERH
+       /*
+        * Register the GPIO to pin mappings. As pins with GPIO ports
+        * must come first in the ranges, skip the pins without GPIO
+        * ports by stopping at the first range that contains such a
+        * pin.
+        */
+       for (i = 0; i < pfc->nr_ranges; ++i) {
+               const struct sh_pfc_pin_range *range = &pfc->ranges[i];
+               int ret;
+
+               if (range->start >= pfc->nr_gpio_pins)
+                       break;
+
+               ret = gpiochip_add_pin_range(&chip->gpio_chip,
+                       dev_name(pfc->dev), range->start, range->start,
+                       range->end - range->start + 1);
+               if (ret < 0)
+                       return ret;
        }
 
-#ifdef CONFIG_SUPERH
        /* Register the function GPIOs chip. */
        if (pfc->info->nr_func_gpios == 0)
                return 0;