]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
driver:gpio remove all usage of gpio_remove retval in driver
authorabdoulaye berthe <berthe.ab@gmail.com>
Sat, 12 Jul 2014 20:30:14 +0000 (22:30 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 18 Sep 2014 18:03:10 +0000 (11:03 -0700)
this remove all reference to gpio_remove retval in all driver
except pinctrl and gpio. the same thing is done for gpio and
pinctrl in two different patches.

Signed-off-by: Abdoulaye Berthe <berthe.ab@gmail.com>
Acked-by: Michael Büsch <m@bues.ch>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
27 files changed:
arch/arm/common/scoop.c
arch/mips/txx9/generic/setup.c
arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
arch/sh/boards/mach-x3proto/gpio.c
drivers/bcma/driver_gpio.c
drivers/gpio/gpio-zynq.c
drivers/hid/hid-cp2112.c
drivers/input/keyboard/adp5588-keys.c
drivers/input/keyboard/adp5589-keys.c
drivers/input/touchscreen/ad7879.c
drivers/leds/leds-pca9532.c
drivers/leds/leds-tca6507.c
drivers/media/dvb-frontends/cxd2820r_core.c
drivers/mfd/asic3.c
drivers/mfd/htc-i2cpld.c
drivers/mfd/sm501.c
drivers/mfd/tc6393xb.c
drivers/mfd/ucb1x00-core.c
drivers/platform/x86/intel_pmic_gpio.c
drivers/ssb/driver_gpio.c
drivers/staging/vme/devices/vme_pio2_gpio.c
drivers/tty/serial/max310x.c
drivers/video/fbdev/via/via-gpio.c
sound/soc/codecs/wm5100.c
sound/soc/codecs/wm8903.c
sound/soc/codecs/wm8962.c
sound/soc/codecs/wm8996.c

index a20fa80776d3d873c6ef8ef849a8ac2b214b2776..45f4c21e393c1992bfdcc980e859fe081968dffd 100644 (file)
@@ -243,18 +243,12 @@ err_ioremap:
 static int scoop_remove(struct platform_device *pdev)
 {
        struct scoop_dev *sdev = platform_get_drvdata(pdev);
-       int ret;
 
        if (!sdev)
                return -EINVAL;
 
-       if (sdev->gpio.base != -1) {
-               ret = gpiochip_remove(&sdev->gpio);
-               if (ret) {
-                       dev_err(&pdev->dev, "Can't remove gpio chip: %d\n", ret);
-                       return ret;
-               }
-       }
+       if (sdev->gpio.base != -1)
+               gpiochip_remove(&sdev->gpio);
 
        platform_set_drvdata(pdev, NULL);
        iounmap(sdev->base);
index 9ff200ae1c9aec94f77b683ac7d48d4761bea93b..2791b8641df64c4624fc480ef5ee3a37e36c3a77 100644 (file)
@@ -789,11 +789,11 @@ void __init txx9_iocled_init(unsigned long baseaddr,
        if (platform_device_add(pdev))
                goto out_pdev;
        return;
+
 out_pdev:
        platform_device_put(pdev);
 out_gpio:
-       if (gpiochip_remove(&iocled->chip))
-               return;
+       gpiochip_remove(&iocled->chip);
 out_unmap:
        iounmap(iocled->mmioaddr);
 out_free:
index e238b6a55b1593e08f43e029bf6b4f9af1a7836f..73997027b08544892c1f4f4bb87e93f41c2ae707 100644 (file)
@@ -141,7 +141,8 @@ static int mcu_gpiochip_add(struct mcu *mcu)
 
 static int mcu_gpiochip_remove(struct mcu *mcu)
 {
-       return gpiochip_remove(&mcu->gc);
+       gpiochip_remove(&mcu->gc);
+       return 0;
 }
 
 static int mcu_probe(struct i2c_client *client, const struct i2c_device_id *id)
index 3ea65e9b56e80ed34e5aad1055ce31df6666acb3..f035a7ac6456213f94d0ddae409f8746d4b9b9f5 100644 (file)
@@ -128,10 +128,8 @@ int __init x3proto_gpio_setup(void)
        return 0;
 
 err_irq:
-       ret = gpiochip_remove(&x3proto_gpio_chip);
-       if (unlikely(ret))
-               pr_err("Failed deregistering GPIO\n");
-
+       gpiochip_remove(&x3proto_gpio_chip);
+       ret = 0;
 err_gpio:
        synchronize_irq(ilsel);
 
index aec9f850b4a80eba3ea7c0b06bd5df647829980e..710fa62dd5ae2649d4fb3524d35fd8871ba87409 100644 (file)
@@ -251,5 +251,6 @@ int bcma_gpio_init(struct bcma_drv_cc *cc)
 int bcma_gpio_unregister(struct bcma_drv_cc *cc)
 {
        bcma_gpio_irq_domain_exit(cc);
-       return gpiochip_remove(&cc->gpio);
+       gpiochip_remove(&cc->gpio);
+       return 0;
 }
index 1e6f19a07454e5d8a4bd8ed5131f7f28bfc59c34..5dfbced248153841aeb36e7236e3dad4f3066055 100644 (file)
@@ -671,8 +671,7 @@ static int zynq_gpio_probe(struct platform_device *pdev)
        return 0;
 
 err_rm_gpiochip:
-       if (gpiochip_remove(chip))
-               dev_err(&pdev->dev, "Failed to remove gpio chip\n");
+       gpiochip_remove(chip);
 err_disable_clk:
        clk_disable_unprepare(gpio->clk);
 
index a822db5a8338090125688d286ddd8fba0cbbd77d..3318de690e00666bf7da60c84189a1fc54a0a544 100644 (file)
@@ -1069,8 +1069,7 @@ static int cp2112_probe(struct hid_device *hdev, const struct hid_device_id *id)
        return ret;
 
 err_gpiochip_remove:
-       if (gpiochip_remove(&dev->gc) < 0)
-               hid_err(hdev, "error removing gpio chip\n");
+       gpiochip_remove(&dev->gc);
 err_free_i2c:
        i2c_del_adapter(&dev->adap);
 err_free_dev:
@@ -1089,8 +1088,7 @@ static void cp2112_remove(struct hid_device *hdev)
        struct cp2112_device *dev = hid_get_drvdata(hdev);
 
        sysfs_remove_group(&hdev->dev.kobj, &cp2112_attr_group);
-       if (gpiochip_remove(&dev->gc))
-               hid_err(hdev, "unable to remove gpio chip\n");
+       gpiochip_remove(&dev->gc);
        i2c_del_adapter(&dev->adap);
        /* i2c_del_adapter has finished removing all i2c devices from our
         * adapter. Well behaved devices should no longer call our cp2112_xfer
index 5ef7fcf0e2509b8196cf69a993247febae4c20b7..b97ed443e0a49bd02288f8d74cdcb669af730f17 100644 (file)
@@ -251,9 +251,7 @@ static void adp5588_gpio_remove(struct adp5588_kpad *kpad)
                        dev_warn(dev, "teardown failed %d\n", error);
        }
 
-       error = gpiochip_remove(&kpad->gc);
-       if (error)
-               dev_warn(dev, "gpiochip_remove failed %d\n", error);
+       gpiochip_remove(&kpad->gc);
 }
 #else
 static inline int adp5588_gpio_add(struct adp5588_kpad *kpad)
index 6329549bf6add071e19c6c07b16e5db0dd8131c7..a45267729dfcfde8bcc6b1799b69b53de14f9f58 100644 (file)
@@ -567,9 +567,7 @@ static void adp5589_gpio_remove(struct adp5589_kpad *kpad)
                        dev_warn(dev, "teardown failed %d\n", error);
        }
 
-       error = gpiochip_remove(&kpad->gc);
-       if (error)
-               dev_warn(dev, "gpiochip_remove failed %d\n", error);
+       gpiochip_remove(&kpad->gc);
 }
 #else
 static inline int adp5589_gpio_add(struct adp5589_kpad *kpad)
index fce590677b7b0e4515dbcb0b938569ecbac1e9d6..1eb9d3c20886fc3cfd119921c593b2ddb771cbd2 100644 (file)
@@ -470,14 +470,10 @@ static int ad7879_gpio_add(struct ad7879 *ts,
 static void ad7879_gpio_remove(struct ad7879 *ts)
 {
        const struct ad7879_platform_data *pdata = dev_get_platdata(ts->dev);
-       int ret;
 
-       if (pdata->gpio_export) {
-               ret = gpiochip_remove(&ts->gc);
-               if (ret)
-                       dev_err(ts->dev, "failed to remove gpio %d\n",
-                               ts->gc.base);
-       }
+       if (pdata->gpio_export)
+               gpiochip_remove(&ts->gc);
+
 }
 #else
 static inline int ad7879_gpio_add(struct ad7879 *ts,
index 4a0e786b7832bb8834ea4e6a46e20f4e24cf7898..5a6363d161a2f91e203a58923a3b09cc26a980b9 100644 (file)
@@ -319,14 +319,8 @@ static int pca9532_destroy_devices(struct pca9532_data *data, int n_devs)
        }
 
 #ifdef CONFIG_LEDS_PCA9532_GPIO
-       if (data->gpio.dev) {
-               int err = gpiochip_remove(&data->gpio);
-               if (err) {
-                       dev_err(&data->client->dev, "%s failed, %d\n",
-                                               "gpiochip_remove()", err);
-                       return err;
-               }
-       }
+       if (data->gpio.dev)
+               gpiochip_remove(&data->gpio);
 #endif
 
        return 0;
index 3d9e267a56c428580bfaa074ce08053bd86ae34a..20fa8e77f1863c5aa9bbe78a5eb028d6c32cc49c 100644 (file)
@@ -667,11 +667,8 @@ static int tca6507_probe_gpios(struct i2c_client *client,
 
 static void tca6507_remove_gpio(struct tca6507_chip *tca)
 {
-       if (tca->gpio.ngpio) {
-               int err = gpiochip_remove(&tca->gpio);
-               dev_err(&tca->client->dev, "%s failed, %d\n",
-                       "gpiochip_remove()", err);
-       }
+       if (tca->gpio.ngpio)
+               gpiochip_remove(&tca->gpio);
 }
 #else /* CONFIG_GPIOLIB */
 static int tca6507_probe_gpios(struct i2c_client *client,
index 03930d5e9fea4cbf2a5787aad71d08af809544fa..51ef893126151071c511cd7f9e77242507f6065b 100644 (file)
@@ -584,18 +584,14 @@ static int cxd2820r_get_frontend_algo(struct dvb_frontend *fe)
 static void cxd2820r_release(struct dvb_frontend *fe)
 {
        struct cxd2820r_priv *priv = fe->demodulator_priv;
-       int uninitialized_var(ret); /* silence compiler warning */
 
        dev_dbg(&priv->i2c->dev, "%s\n", __func__);
 
 #ifdef CONFIG_GPIOLIB
        /* remove GPIOs */
-       if (priv->gpio_chip.label) {
-               ret = gpiochip_remove(&priv->gpio_chip);
-               if (ret)
-                       dev_err(&priv->i2c->dev, "%s: gpiochip_remove() " \
-                                       "failed=%d\n", KBUILD_MODNAME, ret);
-       }
+       if (priv->gpio_chip.label)
+               gpiochip_remove(&priv->gpio_chip);
+
 #endif
        kfree(priv);
        return;
index 9fc4186d41328af729beb99cb30488a89b64d937..977bd3a3eed01149d9d5ef670cfa175922250232 100644 (file)
@@ -605,7 +605,8 @@ static int asic3_gpio_remove(struct platform_device *pdev)
 {
        struct asic3 *asic = platform_get_drvdata(pdev);
 
-       return gpiochip_remove(&asic->gpio);
+       gpiochip_remove(&asic->gpio);
+       return 0;
 }
 
 static void asic3_clk_enable(struct asic3 *asic, struct asic3_clk *clk)
index b44f0203983bfb5117c02be8469074814c24a18f..eab3fb028447838a22c168cfdf0b01e21d10e099 100644 (file)
@@ -481,15 +481,9 @@ static int htcpld_register_chip_gpio(
 
        ret = gpiochip_add(&(chip->chip_in));
        if (ret) {
-               int error;
-
                dev_warn(dev, "Unable to register input GPIOs for 0x%x: %d\n",
                         plat_chip_data->addr, ret);
-
-               error = gpiochip_remove(&(chip->chip_out));
-               if (error)
-                       dev_warn(dev, "Error while trying to unregister gpio chip: %d\n", error);
-
+               gpiochip_remove(&(chip->chip_out));
                return ret;
        }
 
index 81e6d0932bf0afa096e84387cb241c4f6e57785e..02027b7f1223b1e00199d1c9915d21294fb6cb72 100644 (file)
@@ -1047,7 +1047,6 @@ static int sm501_register_gpio(struct sm501_devdata *sm)
        struct sm501_gpio *gpio = &sm->gpio;
        resource_size_t iobase = sm->io_res->start + SM501_GPIO;
        int ret;
-       int tmp;
 
        dev_dbg(sm->dev, "registering gpio block %08llx\n",
                (unsigned long long)iobase);
@@ -1086,11 +1085,7 @@ static int sm501_register_gpio(struct sm501_devdata *sm)
        return 0;
 
  err_low_chip:
-       tmp = gpiochip_remove(&gpio->low.gpio);
-       if (tmp) {
-               dev_err(sm->dev, "cannot remove low chip, cannot tidy up\n");
-               return ret;
-       }
+       gpiochip_remove(&gpio->low.gpio);
 
  err_mapped:
        iounmap(gpio->regs);
@@ -1105,18 +1100,12 @@ static int sm501_register_gpio(struct sm501_devdata *sm)
 static void sm501_gpio_remove(struct sm501_devdata *sm)
 {
        struct sm501_gpio *gpio = &sm->gpio;
-       int ret;
 
        if (!sm->gpio.registered)
                return;
 
-       ret = gpiochip_remove(&gpio->low.gpio);
-       if (ret)
-               dev_err(sm->dev, "cannot remove low chip, cannot tidy up\n");
-
-       ret = gpiochip_remove(&gpio->high.gpio);
-       if (ret)
-               dev_err(sm->dev, "cannot remove high chip, cannot tidy up\n");
+       gpiochip_remove(&gpio->low.gpio);
+       gpiochip_remove(&gpio->high.gpio);
 
        iounmap(gpio->regs);
        release_resource(gpio->regs_res);
index 11c19e5385510ccf8d8272e709e7b95264b66afc..4fac16bcd7320dd495ebdf9683ee6bb6d3db76dd 100644 (file)
@@ -607,7 +607,7 @@ static int tc6393xb_probe(struct platform_device *dev)
        struct tc6393xb_platform_data *tcpd = dev_get_platdata(&dev->dev);
        struct tc6393xb *tc6393xb;
        struct resource *iomem, *rscr;
-       int ret, temp;
+       int ret;
 
        iomem = platform_get_resource(dev, IORESOURCE_MEM, 0);
        if (!iomem)
@@ -714,7 +714,7 @@ err_setup:
 
 err_gpio_add:
        if (tc6393xb->gpio.base != -1)
-               temp = gpiochip_remove(&tc6393xb->gpio);
+               gpiochip_remove(&tc6393xb->gpio);
        tcpd->disable(dev);
 err_enable:
        clk_disable(tc6393xb->clk);
@@ -744,13 +744,8 @@ static int tc6393xb_remove(struct platform_device *dev)
 
        tc6393xb_detach_irq(dev);
 
-       if (tc6393xb->gpio.base != -1) {
-               ret = gpiochip_remove(&tc6393xb->gpio);
-               if (ret) {
-                       dev_err(&dev->dev, "Can't remove gpio chip: %d\n", ret);
-                       return ret;
-               }
-       }
+       if (tc6393xb->gpio.base != -1)
+               gpiochip_remove(&tc6393xb->gpio);
 
        ret = tcpd->disable(dev);
        clk_disable(tc6393xb->clk);
index 153d595afaacb50306bd017a1893c8f27b1c0ca3..58ea9fdd3a15c07c2331544e78e001d99f4abfcf 100644 (file)
@@ -621,7 +621,6 @@ static void ucb1x00_remove(struct mcp *mcp)
        struct ucb1x00_plat_data *pdata = mcp->attached_device.platform_data;
        struct ucb1x00 *ucb = mcp_get_drvdata(mcp);
        struct list_head *l, *n;
-       int ret;
 
        mutex_lock(&ucb1x00_mutex);
        list_del(&ucb->node);
@@ -631,11 +630,8 @@ static void ucb1x00_remove(struct mcp *mcp)
        }
        mutex_unlock(&ucb1x00_mutex);
 
-       if (ucb->gpio.base != -1) {
-               ret = gpiochip_remove(&ucb->gpio);
-               if (ret)
-                       dev_err(&ucb->dev, "Can't remove gpio chip: %d\n", ret);
-       }
+       if (ucb->gpio.base != -1)
+               gpiochip_remove(&ucb->gpio);
 
        irq_set_chained_handler(ucb->irq, NULL);
        irq_free_descs(ucb->irq_base, 16);
index 40929e4f7ad73f407bada0062d3fd8e8bb5debe5..04fed00b88e9546a159a6585b6a0326da55e16a2 100644 (file)
@@ -301,8 +301,7 @@ static int platform_pmic_gpio_probe(struct platform_device *pdev)
        return 0;
 
 fail_request_irq:
-       if (gpiochip_remove(&pg->chip))
-               pr_err("gpiochip_remove failed\n");
+       gpiochip_remove(&pg->chip);
 err:
        iounmap(pg->gpiointr);
 err2:
index ba350d2035c0d868cc6a9436eb65c593805c5ae5..f92e266d48f88980e546e0add7ab26205d81c127 100644 (file)
@@ -475,7 +475,8 @@ int ssb_gpio_unregister(struct ssb_bus *bus)
 {
        if (ssb_chipco_available(&bus->chipco) ||
            ssb_extif_available(&bus->extif)) {
-               return gpiochip_remove(&bus->gpio);
+               gpiochip_remove(&bus->gpio);
+               return 0;
        } else {
                SSB_WARN_ON(1);
        }
index f00af0786af3d2f0a28ac55921e5dbf94d961883..3304d9227c3cb9d8f4e4794f2f3e077a7b3fb2e6 100644 (file)
@@ -221,9 +221,7 @@ void pio2_gpio_exit(struct pio2_card *card)
 {
        const char *label = card->gc.label;
 
-       if (gpiochip_remove(&(card->gc)))
-               dev_err(&card->vdev->dev, "Failed to remove GPIO\n");
-
+       gpiochip_remove(&(card->gc));
        kfree(label);
 }
 
index 82573dc4d8cf8ebf99d84d40056d5fb5dac85303..0041a64cc86e576b180dfaf0a78630657f9493ca 100644 (file)
@@ -1248,7 +1248,7 @@ static int max310x_probe(struct device *dev, struct max310x_devtype *devtype,
        mutex_destroy(&s->mutex);
 
 #ifdef CONFIG_GPIOLIB
-       WARN_ON(gpiochip_remove(&s->gpio));
+       gpiochip_remove(&s->gpio);
 
 out_uart:
 #endif
@@ -1263,12 +1263,10 @@ out_clk:
 static int max310x_remove(struct device *dev)
 {
        struct max310x_port *s = dev_get_drvdata(dev);
-       int i, ret = 0;
+       int i;
 
 #ifdef CONFIG_GPIOLIB
-       ret = gpiochip_remove(&s->gpio);
-       if (ret)
-               return ret;
+       gpiochip_remove(&s->gpio);
 #endif
 
        for (i = 0; i < s->uart.nr; i++) {
@@ -1282,7 +1280,7 @@ static int max310x_remove(struct device *dev)
        uart_unregister_driver(&s->uart);
        clk_disable_unprepare(s->clk);
 
-       return ret;
+       return 0;
 }
 
 static const struct of_device_id __maybe_unused max310x_dt_ids[] = {
index e408679081ab25a8adb3fe543a8c70c45e4289b5..6f433b8cee1267653e05c4a6e4ba7ba5062e4253 100644 (file)
@@ -270,7 +270,7 @@ static int viafb_gpio_probe(struct platform_device *platdev)
 static int viafb_gpio_remove(struct platform_device *platdev)
 {
        unsigned long flags;
-       int ret = 0, i;
+       int i;
 
 #ifdef CONFIG_PM
        viafb_pm_unregister(&viafb_gpio_pm_hooks);
@@ -280,11 +280,7 @@ static int viafb_gpio_remove(struct platform_device *platdev)
         * Get unregistered.
         */
        if (viafb_gpio_config.gpio_chip.ngpio > 0) {
-               ret = gpiochip_remove(&viafb_gpio_config.gpio_chip);
-               if (ret) { /* Somebody still using it? */
-                       printk(KERN_ERR "Viafb: GPIO remove failed\n");
-                       return ret;
-               }
+               gpiochip_remove(&viafb_gpio_config.gpio_chip);
        }
        /*
         * Disable the ports.
@@ -294,7 +290,7 @@ static int viafb_gpio_remove(struct platform_device *platdev)
                viafb_gpio_disable(viafb_gpio_config.active_gpios[i]);
        viafb_gpio_config.gpio_chip.ngpio = 0;
        spin_unlock_irqrestore(&viafb_gpio_config.vdev->reg_lock, flags);
-       return ret;
+       return 0;
 }
 
 static struct platform_driver via_gpio_driver = {
index 7bb0d36d4c5485b703d2e7cd0adede1e732446b0..a01ad629ed6159800d57447c8efe80797af79625 100644 (file)
@@ -2319,11 +2319,8 @@ static void wm5100_init_gpio(struct i2c_client *i2c)
 static void wm5100_free_gpio(struct i2c_client *i2c)
 {
        struct wm5100_priv *wm5100 = i2c_get_clientdata(i2c);
-       int ret;
 
-       ret = gpiochip_remove(&wm5100->gpio_chip);
-       if (ret != 0)
-               dev_err(&i2c->dev, "Failed to remove GPIOs: %d\n", ret);
+       gpiochip_remove(&wm5100->gpio_chip);
 }
 #else
 static void wm5100_init_gpio(struct i2c_client *i2c)
index aa0984864e761f52d677d458fbee6969588f5de8..c038b3e04398069b050b526ab2b6baca5cdfd2a9 100644 (file)
@@ -1877,11 +1877,7 @@ static void wm8903_init_gpio(struct wm8903_priv *wm8903)
 
 static void wm8903_free_gpio(struct wm8903_priv *wm8903)
 {
-       int ret;
-
-       ret = gpiochip_remove(&wm8903->gpio_chip);
-       if (ret != 0)
-               dev_err(wm8903->dev, "Failed to remove GPIOs: %d\n", ret);
+       gpiochip_remove(&wm8903->gpio_chip);
 }
 #else
 static void wm8903_init_gpio(struct wm8903_priv *wm8903)
index 1098ae32f1f9373a7600b4fea928501f02fd16b5..9077411e62ce5d3837ee4df65b1db6e48eda77dd 100644 (file)
@@ -3398,11 +3398,8 @@ static void wm8962_init_gpio(struct snd_soc_codec *codec)
 static void wm8962_free_gpio(struct snd_soc_codec *codec)
 {
        struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec);
-       int ret;
 
-       ret = gpiochip_remove(&wm8962->gpio_chip);
-       if (ret != 0)
-               dev_err(codec->dev, "Failed to remove GPIOs: %d\n", ret);
+       gpiochip_remove(&wm8962->gpio_chip);
 }
 #else
 static void wm8962_init_gpio(struct snd_soc_codec *codec)
index f16ff4f569237828ffa3c140e41815c616da1a8f..b1dcc11c1b23bd0134940d2f9571d14b9e1dac92 100644 (file)
@@ -2216,11 +2216,7 @@ static void wm8996_init_gpio(struct wm8996_priv *wm8996)
 
 static void wm8996_free_gpio(struct wm8996_priv *wm8996)
 {
-       int ret;
-
-       ret = gpiochip_remove(&wm8996->gpio_chip);
-       if (ret != 0)
-               dev_err(wm8996->dev, "Failed to remove GPIOs: %d\n", ret);
+       gpiochip_remove(&wm8996->gpio_chip);
 }
 #else
 static void wm8996_init_gpio(struct wm8996_priv *wm8996)