gpio: pca953x: Drop deprecated DT bindings
authorMarkus Pargmann <mpa@pengutronix.de>
Tue, 29 Jul 2014 07:24:43 +0000 (09:24 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 28 Aug 2014 12:19:40 +0000 (14:19 +0200)
Drop deprecated DT bindings and use automaticly assigned gpio and irq
bases.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-pca953x.c

index f9961eea2120a051b0ada70a3f6483baaa6a826c..e2da64abbccd9a8ebc42a4b2f29b76f707c82e0b 100644 (file)
@@ -520,7 +520,7 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
        struct i2c_client *client = chip->client;
        int ret, i, offset = 0;
 
-       if (irq_base != -1
+       if (client->irq && irq_base != -1
                        && (id->driver_data & PCA_INT)) {
 
                switch (chip->chip_type) {
@@ -586,50 +586,6 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
 }
 #endif
 
-/*
- * Handlers for alternative sources of platform_data
- */
-#ifdef CONFIG_OF_GPIO
-/*
- * Translate OpenFirmware node properties into platform_data
- * WARNING: This is DEPRECATED and will be removed eventually!
- */
-static void
-pca953x_get_alt_pdata(struct i2c_client *client, int *gpio_base, u32 *invert)
-{
-       struct device_node *node;
-       const __be32 *val;
-       int size;
-
-       *gpio_base = -1;
-
-       node = client->dev.of_node;
-       if (node == NULL)
-               return;
-
-       val = of_get_property(node, "linux,gpio-base", &size);
-       WARN(val, "%s: device-tree property 'linux,gpio-base' is deprecated!", __func__);
-       if (val) {
-               if (size != sizeof(*val))
-                       dev_warn(&client->dev, "%s: wrong linux,gpio-base\n",
-                                node->full_name);
-               else
-                       *gpio_base = be32_to_cpup(val);
-       }
-
-       val = of_get_property(node, "polarity", NULL);
-       WARN(val, "%s: device-tree property 'polarity' is deprecated!", __func__);
-       if (val)
-               *invert = *val;
-}
-#else
-static void
-pca953x_get_alt_pdata(struct i2c_client *client, int *gpio_base, u32 *invert)
-{
-       *gpio_base = -1;
-}
-#endif
-
 static int device_pca953x_init(struct pca953x_chip *chip, u32 invert)
 {
        int ret;
@@ -704,12 +660,8 @@ static int pca953x_probe(struct i2c_client *client,
                invert = pdata->invert;
                chip->names = pdata->names;
        } else {
-               pca953x_get_alt_pdata(client, &chip->gpio_start, &invert);
-#ifdef CONFIG_OF_GPIO
-               /* If I2C node has no interrupts property, disable GPIO interrupts */
-               if (of_find_property(client->dev.of_node, "interrupts", NULL) == NULL)
-                       irq_base = -1;
-#endif
+               chip->gpio_start = -1;
+               irq_base = 0;
        }
 
        chip->client = client;