gpio: gpio-mxs: Remove unneeded dt checks
authorFabio Estevam <fabio.estevam@freescale.com>
Tue, 5 Nov 2013 19:21:22 +0000 (17:21 -0200)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 6 Nov 2013 09:51:24 +0000 (10:51 +0100)
mxs is a devicetree only platform, so there is no need to check whether we
are in dt or platform data case.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-mxs.c

index f8e6af20dfbf1d0efc5fce0060b6ace3792cb1ad..532bcb336eff54dfba0fbf9d8347b07e7f0f1ee3 100644 (file)
@@ -254,7 +254,6 @@ static int mxs_gpio_probe(struct platform_device *pdev)
        struct device_node *parent;
        static void __iomem *base;
        struct mxs_gpio_port *port;
-       struct resource *iores = NULL;
        int irq_base;
        int err;
 
@@ -262,16 +261,10 @@ static int mxs_gpio_probe(struct platform_device *pdev)
        if (!port)
                return -ENOMEM;
 
-       if (np) {
-               port->id = of_alias_get_id(np, "gpio");
-               if (port->id < 0)
-                       return port->id;
-               port->devid = (enum mxs_gpio_id) of_id->data;
-       } else {
-               port->id = pdev->id;
-               port->devid = pdev->id_entry->driver_data;
-       }
-
+       port->id = of_alias_get_id(np, "gpio");
+       if (port->id < 0)
+               return port->id;
+       port->devid = (enum mxs_gpio_id) of_id->data;
        port->irq = platform_get_irq(pdev, 0);
        if (port->irq < 0)
                return port->irq;
@@ -281,18 +274,11 @@ static int mxs_gpio_probe(struct platform_device *pdev)
         * share the same one
         */
        if (!base) {
-               if (np) {
-                       parent = of_get_parent(np);
-                       base = of_iomap(parent, 0);
-                       of_node_put(parent);
-                       if (!base)
-                               return -EADDRNOTAVAIL;
-               } else {
-                       iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-                       base = devm_ioremap_resource(&pdev->dev, iores);
-                       if (IS_ERR(base))
-                               return PTR_ERR(base);
-               }
+               parent = of_get_parent(np);
+               base = of_iomap(parent, 0);
+               of_node_put(parent);
+               if (!base)
+                       return -EADDRNOTAVAIL;
        }
        port->base = base;