提交 88d5e520 编写于 作者: A abdoulaye berthe 提交者: Linus Walleij

driver:gpio remove all usage of gpio_remove retval in driver

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: NAbdoulaye Berthe <berthe.ab@gmail.com>
Acked-by: NMichael Büsch <m@bues.ch>
Acked-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
Acked-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 2134cb99
...@@ -243,18 +243,12 @@ static int scoop_probe(struct platform_device *pdev) ...@@ -243,18 +243,12 @@ static int scoop_probe(struct platform_device *pdev)
static int scoop_remove(struct platform_device *pdev) static int scoop_remove(struct platform_device *pdev)
{ {
struct scoop_dev *sdev = platform_get_drvdata(pdev); struct scoop_dev *sdev = platform_get_drvdata(pdev);
int ret;
if (!sdev) if (!sdev)
return -EINVAL; return -EINVAL;
if (sdev->gpio.base != -1) { if (sdev->gpio.base != -1)
ret = gpiochip_remove(&sdev->gpio); gpiochip_remove(&sdev->gpio);
if (ret) {
dev_err(&pdev->dev, "Can't remove gpio chip: %d\n", ret);
return ret;
}
}
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
iounmap(sdev->base); iounmap(sdev->base);
......
...@@ -789,11 +789,11 @@ void __init txx9_iocled_init(unsigned long baseaddr, ...@@ -789,11 +789,11 @@ void __init txx9_iocled_init(unsigned long baseaddr,
if (platform_device_add(pdev)) if (platform_device_add(pdev))
goto out_pdev; goto out_pdev;
return; return;
out_pdev: out_pdev:
platform_device_put(pdev); platform_device_put(pdev);
out_gpio: out_gpio:
if (gpiochip_remove(&iocled->chip)) gpiochip_remove(&iocled->chip);
return;
out_unmap: out_unmap:
iounmap(iocled->mmioaddr); iounmap(iocled->mmioaddr);
out_free: out_free:
......
...@@ -141,7 +141,8 @@ static int mcu_gpiochip_add(struct mcu *mcu) ...@@ -141,7 +141,8 @@ static int mcu_gpiochip_add(struct mcu *mcu)
static int mcu_gpiochip_remove(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) static int mcu_probe(struct i2c_client *client, const struct i2c_device_id *id)
......
...@@ -128,10 +128,8 @@ int __init x3proto_gpio_setup(void) ...@@ -128,10 +128,8 @@ int __init x3proto_gpio_setup(void)
return 0; return 0;
err_irq: err_irq:
ret = gpiochip_remove(&x3proto_gpio_chip); gpiochip_remove(&x3proto_gpio_chip);
if (unlikely(ret)) ret = 0;
pr_err("Failed deregistering GPIO\n");
err_gpio: err_gpio:
synchronize_irq(ilsel); synchronize_irq(ilsel);
......
...@@ -251,5 +251,6 @@ int bcma_gpio_init(struct bcma_drv_cc *cc) ...@@ -251,5 +251,6 @@ int bcma_gpio_init(struct bcma_drv_cc *cc)
int bcma_gpio_unregister(struct bcma_drv_cc *cc) int bcma_gpio_unregister(struct bcma_drv_cc *cc)
{ {
bcma_gpio_irq_domain_exit(cc); bcma_gpio_irq_domain_exit(cc);
return gpiochip_remove(&cc->gpio); gpiochip_remove(&cc->gpio);
return 0;
} }
...@@ -671,8 +671,7 @@ static int zynq_gpio_probe(struct platform_device *pdev) ...@@ -671,8 +671,7 @@ static int zynq_gpio_probe(struct platform_device *pdev)
return 0; return 0;
err_rm_gpiochip: err_rm_gpiochip:
if (gpiochip_remove(chip)) gpiochip_remove(chip);
dev_err(&pdev->dev, "Failed to remove gpio chip\n");
err_disable_clk: err_disable_clk:
clk_disable_unprepare(gpio->clk); clk_disable_unprepare(gpio->clk);
......
...@@ -1069,8 +1069,7 @@ static int cp2112_probe(struct hid_device *hdev, const struct hid_device_id *id) ...@@ -1069,8 +1069,7 @@ static int cp2112_probe(struct hid_device *hdev, const struct hid_device_id *id)
return ret; return ret;
err_gpiochip_remove: err_gpiochip_remove:
if (gpiochip_remove(&dev->gc) < 0) gpiochip_remove(&dev->gc);
hid_err(hdev, "error removing gpio chip\n");
err_free_i2c: err_free_i2c:
i2c_del_adapter(&dev->adap); i2c_del_adapter(&dev->adap);
err_free_dev: err_free_dev:
...@@ -1089,8 +1088,7 @@ static void cp2112_remove(struct hid_device *hdev) ...@@ -1089,8 +1088,7 @@ static void cp2112_remove(struct hid_device *hdev)
struct cp2112_device *dev = hid_get_drvdata(hdev); struct cp2112_device *dev = hid_get_drvdata(hdev);
sysfs_remove_group(&hdev->dev.kobj, &cp2112_attr_group); sysfs_remove_group(&hdev->dev.kobj, &cp2112_attr_group);
if (gpiochip_remove(&dev->gc)) gpiochip_remove(&dev->gc);
hid_err(hdev, "unable to remove gpio chip\n");
i2c_del_adapter(&dev->adap); i2c_del_adapter(&dev->adap);
/* i2c_del_adapter has finished removing all i2c devices from our /* i2c_del_adapter has finished removing all i2c devices from our
* adapter. Well behaved devices should no longer call our cp2112_xfer * adapter. Well behaved devices should no longer call our cp2112_xfer
......
...@@ -251,9 +251,7 @@ static void adp5588_gpio_remove(struct adp5588_kpad *kpad) ...@@ -251,9 +251,7 @@ static void adp5588_gpio_remove(struct adp5588_kpad *kpad)
dev_warn(dev, "teardown failed %d\n", error); dev_warn(dev, "teardown failed %d\n", error);
} }
error = gpiochip_remove(&kpad->gc); gpiochip_remove(&kpad->gc);
if (error)
dev_warn(dev, "gpiochip_remove failed %d\n", error);
} }
#else #else
static inline int adp5588_gpio_add(struct adp5588_kpad *kpad) static inline int adp5588_gpio_add(struct adp5588_kpad *kpad)
......
...@@ -567,9 +567,7 @@ static void adp5589_gpio_remove(struct adp5589_kpad *kpad) ...@@ -567,9 +567,7 @@ static void adp5589_gpio_remove(struct adp5589_kpad *kpad)
dev_warn(dev, "teardown failed %d\n", error); dev_warn(dev, "teardown failed %d\n", error);
} }
error = gpiochip_remove(&kpad->gc); gpiochip_remove(&kpad->gc);
if (error)
dev_warn(dev, "gpiochip_remove failed %d\n", error);
} }
#else #else
static inline int adp5589_gpio_add(struct adp5589_kpad *kpad) static inline int adp5589_gpio_add(struct adp5589_kpad *kpad)
......
...@@ -470,14 +470,10 @@ static int ad7879_gpio_add(struct ad7879 *ts, ...@@ -470,14 +470,10 @@ static int ad7879_gpio_add(struct ad7879 *ts,
static void ad7879_gpio_remove(struct ad7879 *ts) static void ad7879_gpio_remove(struct ad7879 *ts)
{ {
const struct ad7879_platform_data *pdata = dev_get_platdata(ts->dev); const struct ad7879_platform_data *pdata = dev_get_platdata(ts->dev);
int ret;
if (pdata->gpio_export) { if (pdata->gpio_export)
ret = gpiochip_remove(&ts->gc); gpiochip_remove(&ts->gc);
if (ret)
dev_err(ts->dev, "failed to remove gpio %d\n",
ts->gc.base);
}
} }
#else #else
static inline int ad7879_gpio_add(struct ad7879 *ts, static inline int ad7879_gpio_add(struct ad7879 *ts,
......
...@@ -319,14 +319,8 @@ static int pca9532_destroy_devices(struct pca9532_data *data, int n_devs) ...@@ -319,14 +319,8 @@ static int pca9532_destroy_devices(struct pca9532_data *data, int n_devs)
} }
#ifdef CONFIG_LEDS_PCA9532_GPIO #ifdef CONFIG_LEDS_PCA9532_GPIO
if (data->gpio.dev) { if (data->gpio.dev)
int err = gpiochip_remove(&data->gpio); gpiochip_remove(&data->gpio);
if (err) {
dev_err(&data->client->dev, "%s failed, %d\n",
"gpiochip_remove()", err);
return err;
}
}
#endif #endif
return 0; return 0;
......
...@@ -667,11 +667,8 @@ static int tca6507_probe_gpios(struct i2c_client *client, ...@@ -667,11 +667,8 @@ static int tca6507_probe_gpios(struct i2c_client *client,
static void tca6507_remove_gpio(struct tca6507_chip *tca) static void tca6507_remove_gpio(struct tca6507_chip *tca)
{ {
if (tca->gpio.ngpio) { if (tca->gpio.ngpio)
int err = gpiochip_remove(&tca->gpio); gpiochip_remove(&tca->gpio);
dev_err(&tca->client->dev, "%s failed, %d\n",
"gpiochip_remove()", err);
}
} }
#else /* CONFIG_GPIOLIB */ #else /* CONFIG_GPIOLIB */
static int tca6507_probe_gpios(struct i2c_client *client, static int tca6507_probe_gpios(struct i2c_client *client,
......
...@@ -584,18 +584,14 @@ static int cxd2820r_get_frontend_algo(struct dvb_frontend *fe) ...@@ -584,18 +584,14 @@ static int cxd2820r_get_frontend_algo(struct dvb_frontend *fe)
static void cxd2820r_release(struct dvb_frontend *fe) static void cxd2820r_release(struct dvb_frontend *fe)
{ {
struct cxd2820r_priv *priv = fe->demodulator_priv; struct cxd2820r_priv *priv = fe->demodulator_priv;
int uninitialized_var(ret); /* silence compiler warning */
dev_dbg(&priv->i2c->dev, "%s\n", __func__); dev_dbg(&priv->i2c->dev, "%s\n", __func__);
#ifdef CONFIG_GPIOLIB #ifdef CONFIG_GPIOLIB
/* remove GPIOs */ /* remove GPIOs */
if (priv->gpio_chip.label) { if (priv->gpio_chip.label)
ret = gpiochip_remove(&priv->gpio_chip); gpiochip_remove(&priv->gpio_chip);
if (ret)
dev_err(&priv->i2c->dev, "%s: gpiochip_remove() " \
"failed=%d\n", KBUILD_MODNAME, ret);
}
#endif #endif
kfree(priv); kfree(priv);
return; return;
......
...@@ -605,7 +605,8 @@ static int asic3_gpio_remove(struct platform_device *pdev) ...@@ -605,7 +605,8 @@ static int asic3_gpio_remove(struct platform_device *pdev)
{ {
struct asic3 *asic = platform_get_drvdata(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) static void asic3_clk_enable(struct asic3 *asic, struct asic3_clk *clk)
......
...@@ -481,15 +481,9 @@ static int htcpld_register_chip_gpio( ...@@ -481,15 +481,9 @@ static int htcpld_register_chip_gpio(
ret = gpiochip_add(&(chip->chip_in)); ret = gpiochip_add(&(chip->chip_in));
if (ret) { if (ret) {
int error;
dev_warn(dev, "Unable to register input GPIOs for 0x%x: %d\n", dev_warn(dev, "Unable to register input GPIOs for 0x%x: %d\n",
plat_chip_data->addr, ret); plat_chip_data->addr, ret);
gpiochip_remove(&(chip->chip_out));
error = gpiochip_remove(&(chip->chip_out));
if (error)
dev_warn(dev, "Error while trying to unregister gpio chip: %d\n", error);
return ret; return ret;
} }
......
...@@ -1047,7 +1047,6 @@ static int sm501_register_gpio(struct sm501_devdata *sm) ...@@ -1047,7 +1047,6 @@ static int sm501_register_gpio(struct sm501_devdata *sm)
struct sm501_gpio *gpio = &sm->gpio; struct sm501_gpio *gpio = &sm->gpio;
resource_size_t iobase = sm->io_res->start + SM501_GPIO; resource_size_t iobase = sm->io_res->start + SM501_GPIO;
int ret; int ret;
int tmp;
dev_dbg(sm->dev, "registering gpio block %08llx\n", dev_dbg(sm->dev, "registering gpio block %08llx\n",
(unsigned long long)iobase); (unsigned long long)iobase);
...@@ -1086,11 +1085,7 @@ static int sm501_register_gpio(struct sm501_devdata *sm) ...@@ -1086,11 +1085,7 @@ static int sm501_register_gpio(struct sm501_devdata *sm)
return 0; return 0;
err_low_chip: err_low_chip:
tmp = gpiochip_remove(&gpio->low.gpio); gpiochip_remove(&gpio->low.gpio);
if (tmp) {
dev_err(sm->dev, "cannot remove low chip, cannot tidy up\n");
return ret;
}
err_mapped: err_mapped:
iounmap(gpio->regs); iounmap(gpio->regs);
...@@ -1105,18 +1100,12 @@ static int sm501_register_gpio(struct sm501_devdata *sm) ...@@ -1105,18 +1100,12 @@ static int sm501_register_gpio(struct sm501_devdata *sm)
static void sm501_gpio_remove(struct sm501_devdata *sm) static void sm501_gpio_remove(struct sm501_devdata *sm)
{ {
struct sm501_gpio *gpio = &sm->gpio; struct sm501_gpio *gpio = &sm->gpio;
int ret;
if (!sm->gpio.registered) if (!sm->gpio.registered)
return; return;
ret = gpiochip_remove(&gpio->low.gpio); gpiochip_remove(&gpio->low.gpio);
if (ret) gpiochip_remove(&gpio->high.gpio);
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");
iounmap(gpio->regs); iounmap(gpio->regs);
release_resource(gpio->regs_res); release_resource(gpio->regs_res);
......
...@@ -607,7 +607,7 @@ static int tc6393xb_probe(struct platform_device *dev) ...@@ -607,7 +607,7 @@ static int tc6393xb_probe(struct platform_device *dev)
struct tc6393xb_platform_data *tcpd = dev_get_platdata(&dev->dev); struct tc6393xb_platform_data *tcpd = dev_get_platdata(&dev->dev);
struct tc6393xb *tc6393xb; struct tc6393xb *tc6393xb;
struct resource *iomem, *rscr; struct resource *iomem, *rscr;
int ret, temp; int ret;
iomem = platform_get_resource(dev, IORESOURCE_MEM, 0); iomem = platform_get_resource(dev, IORESOURCE_MEM, 0);
if (!iomem) if (!iomem)
...@@ -714,7 +714,7 @@ static int tc6393xb_probe(struct platform_device *dev) ...@@ -714,7 +714,7 @@ static int tc6393xb_probe(struct platform_device *dev)
err_gpio_add: err_gpio_add:
if (tc6393xb->gpio.base != -1) if (tc6393xb->gpio.base != -1)
temp = gpiochip_remove(&tc6393xb->gpio); gpiochip_remove(&tc6393xb->gpio);
tcpd->disable(dev); tcpd->disable(dev);
err_enable: err_enable:
clk_disable(tc6393xb->clk); clk_disable(tc6393xb->clk);
...@@ -744,13 +744,8 @@ static int tc6393xb_remove(struct platform_device *dev) ...@@ -744,13 +744,8 @@ static int tc6393xb_remove(struct platform_device *dev)
tc6393xb_detach_irq(dev); tc6393xb_detach_irq(dev);
if (tc6393xb->gpio.base != -1) { if (tc6393xb->gpio.base != -1)
ret = gpiochip_remove(&tc6393xb->gpio); gpiochip_remove(&tc6393xb->gpio);
if (ret) {
dev_err(&dev->dev, "Can't remove gpio chip: %d\n", ret);
return ret;
}
}
ret = tcpd->disable(dev); ret = tcpd->disable(dev);
clk_disable(tc6393xb->clk); clk_disable(tc6393xb->clk);
......
...@@ -621,7 +621,6 @@ static void ucb1x00_remove(struct mcp *mcp) ...@@ -621,7 +621,6 @@ static void ucb1x00_remove(struct mcp *mcp)
struct ucb1x00_plat_data *pdata = mcp->attached_device.platform_data; struct ucb1x00_plat_data *pdata = mcp->attached_device.platform_data;
struct ucb1x00 *ucb = mcp_get_drvdata(mcp); struct ucb1x00 *ucb = mcp_get_drvdata(mcp);
struct list_head *l, *n; struct list_head *l, *n;
int ret;
mutex_lock(&ucb1x00_mutex); mutex_lock(&ucb1x00_mutex);
list_del(&ucb->node); list_del(&ucb->node);
...@@ -631,11 +630,8 @@ static void ucb1x00_remove(struct mcp *mcp) ...@@ -631,11 +630,8 @@ static void ucb1x00_remove(struct mcp *mcp)
} }
mutex_unlock(&ucb1x00_mutex); mutex_unlock(&ucb1x00_mutex);
if (ucb->gpio.base != -1) { if (ucb->gpio.base != -1)
ret = gpiochip_remove(&ucb->gpio); gpiochip_remove(&ucb->gpio);
if (ret)
dev_err(&ucb->dev, "Can't remove gpio chip: %d\n", ret);
}
irq_set_chained_handler(ucb->irq, NULL); irq_set_chained_handler(ucb->irq, NULL);
irq_free_descs(ucb->irq_base, 16); irq_free_descs(ucb->irq_base, 16);
......
...@@ -301,8 +301,7 @@ static int platform_pmic_gpio_probe(struct platform_device *pdev) ...@@ -301,8 +301,7 @@ static int platform_pmic_gpio_probe(struct platform_device *pdev)
return 0; return 0;
fail_request_irq: fail_request_irq:
if (gpiochip_remove(&pg->chip)) gpiochip_remove(&pg->chip);
pr_err("gpiochip_remove failed\n");
err: err:
iounmap(pg->gpiointr); iounmap(pg->gpiointr);
err2: err2:
......
...@@ -475,7 +475,8 @@ int ssb_gpio_unregister(struct ssb_bus *bus) ...@@ -475,7 +475,8 @@ int ssb_gpio_unregister(struct ssb_bus *bus)
{ {
if (ssb_chipco_available(&bus->chipco) || if (ssb_chipco_available(&bus->chipco) ||
ssb_extif_available(&bus->extif)) { ssb_extif_available(&bus->extif)) {
return gpiochip_remove(&bus->gpio); gpiochip_remove(&bus->gpio);
return 0;
} else { } else {
SSB_WARN_ON(1); SSB_WARN_ON(1);
} }
......
...@@ -221,9 +221,7 @@ void pio2_gpio_exit(struct pio2_card *card) ...@@ -221,9 +221,7 @@ void pio2_gpio_exit(struct pio2_card *card)
{ {
const char *label = card->gc.label; const char *label = card->gc.label;
if (gpiochip_remove(&(card->gc))) gpiochip_remove(&(card->gc));
dev_err(&card->vdev->dev, "Failed to remove GPIO\n");
kfree(label); kfree(label);
} }
...@@ -1248,7 +1248,7 @@ static int max310x_probe(struct device *dev, struct max310x_devtype *devtype, ...@@ -1248,7 +1248,7 @@ static int max310x_probe(struct device *dev, struct max310x_devtype *devtype,
mutex_destroy(&s->mutex); mutex_destroy(&s->mutex);
#ifdef CONFIG_GPIOLIB #ifdef CONFIG_GPIOLIB
WARN_ON(gpiochip_remove(&s->gpio)); gpiochip_remove(&s->gpio);
out_uart: out_uart:
#endif #endif
...@@ -1263,12 +1263,10 @@ static int max310x_probe(struct device *dev, struct max310x_devtype *devtype, ...@@ -1263,12 +1263,10 @@ static int max310x_probe(struct device *dev, struct max310x_devtype *devtype,
static int max310x_remove(struct device *dev) static int max310x_remove(struct device *dev)
{ {
struct max310x_port *s = dev_get_drvdata(dev); struct max310x_port *s = dev_get_drvdata(dev);
int i, ret = 0; int i;
#ifdef CONFIG_GPIOLIB #ifdef CONFIG_GPIOLIB
ret = gpiochip_remove(&s->gpio); gpiochip_remove(&s->gpio);
if (ret)
return ret;
#endif #endif
for (i = 0; i < s->uart.nr; i++) { for (i = 0; i < s->uart.nr; i++) {
...@@ -1282,7 +1280,7 @@ static int max310x_remove(struct device *dev) ...@@ -1282,7 +1280,7 @@ static int max310x_remove(struct device *dev)
uart_unregister_driver(&s->uart); uart_unregister_driver(&s->uart);
clk_disable_unprepare(s->clk); clk_disable_unprepare(s->clk);
return ret; return 0;
} }
static const struct of_device_id __maybe_unused max310x_dt_ids[] = { static const struct of_device_id __maybe_unused max310x_dt_ids[] = {
......
...@@ -270,7 +270,7 @@ static int viafb_gpio_probe(struct platform_device *platdev) ...@@ -270,7 +270,7 @@ static int viafb_gpio_probe(struct platform_device *platdev)
static int viafb_gpio_remove(struct platform_device *platdev) static int viafb_gpio_remove(struct platform_device *platdev)
{ {
unsigned long flags; unsigned long flags;
int ret = 0, i; int i;
#ifdef CONFIG_PM #ifdef CONFIG_PM
viafb_pm_unregister(&viafb_gpio_pm_hooks); viafb_pm_unregister(&viafb_gpio_pm_hooks);
...@@ -280,11 +280,7 @@ static int viafb_gpio_remove(struct platform_device *platdev) ...@@ -280,11 +280,7 @@ static int viafb_gpio_remove(struct platform_device *platdev)
* Get unregistered. * Get unregistered.
*/ */
if (viafb_gpio_config.gpio_chip.ngpio > 0) { if (viafb_gpio_config.gpio_chip.ngpio > 0) {
ret = gpiochip_remove(&viafb_gpio_config.gpio_chip); gpiochip_remove(&viafb_gpio_config.gpio_chip);
if (ret) { /* Somebody still using it? */
printk(KERN_ERR "Viafb: GPIO remove failed\n");
return ret;
}
} }
/* /*
* Disable the ports. * Disable the ports.
...@@ -294,7 +290,7 @@ static int viafb_gpio_remove(struct platform_device *platdev) ...@@ -294,7 +290,7 @@ static int viafb_gpio_remove(struct platform_device *platdev)
viafb_gpio_disable(viafb_gpio_config.active_gpios[i]); viafb_gpio_disable(viafb_gpio_config.active_gpios[i]);
viafb_gpio_config.gpio_chip.ngpio = 0; viafb_gpio_config.gpio_chip.ngpio = 0;
spin_unlock_irqrestore(&viafb_gpio_config.vdev->reg_lock, flags); spin_unlock_irqrestore(&viafb_gpio_config.vdev->reg_lock, flags);
return ret; return 0;
} }
static struct platform_driver via_gpio_driver = { static struct platform_driver via_gpio_driver = {
......
...@@ -2319,11 +2319,8 @@ static void wm5100_init_gpio(struct i2c_client *i2c) ...@@ -2319,11 +2319,8 @@ static void wm5100_init_gpio(struct i2c_client *i2c)
static void wm5100_free_gpio(struct i2c_client *i2c) static void wm5100_free_gpio(struct i2c_client *i2c)
{ {
struct wm5100_priv *wm5100 = i2c_get_clientdata(i2c); struct wm5100_priv *wm5100 = i2c_get_clientdata(i2c);
int ret;
ret = gpiochip_remove(&wm5100->gpio_chip); gpiochip_remove(&wm5100->gpio_chip);
if (ret != 0)
dev_err(&i2c->dev, "Failed to remove GPIOs: %d\n", ret);
} }
#else #else
static void wm5100_init_gpio(struct i2c_client *i2c) static void wm5100_init_gpio(struct i2c_client *i2c)
......
...@@ -1877,11 +1877,7 @@ static void wm8903_init_gpio(struct wm8903_priv *wm8903) ...@@ -1877,11 +1877,7 @@ static void wm8903_init_gpio(struct wm8903_priv *wm8903)
static void wm8903_free_gpio(struct wm8903_priv *wm8903) static void wm8903_free_gpio(struct wm8903_priv *wm8903)
{ {
int ret; gpiochip_remove(&wm8903->gpio_chip);
ret = gpiochip_remove(&wm8903->gpio_chip);
if (ret != 0)
dev_err(wm8903->dev, "Failed to remove GPIOs: %d\n", ret);
} }
#else #else
static void wm8903_init_gpio(struct wm8903_priv *wm8903) static void wm8903_init_gpio(struct wm8903_priv *wm8903)
......
...@@ -3398,11 +3398,8 @@ static void wm8962_init_gpio(struct snd_soc_codec *codec) ...@@ -3398,11 +3398,8 @@ static void wm8962_init_gpio(struct snd_soc_codec *codec)
static void wm8962_free_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); struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec);
int ret;
ret = gpiochip_remove(&wm8962->gpio_chip); gpiochip_remove(&wm8962->gpio_chip);
if (ret != 0)
dev_err(codec->dev, "Failed to remove GPIOs: %d\n", ret);
} }
#else #else
static void wm8962_init_gpio(struct snd_soc_codec *codec) static void wm8962_init_gpio(struct snd_soc_codec *codec)
......
...@@ -2216,11 +2216,7 @@ static void wm8996_init_gpio(struct wm8996_priv *wm8996) ...@@ -2216,11 +2216,7 @@ static void wm8996_init_gpio(struct wm8996_priv *wm8996)
static void wm8996_free_gpio(struct wm8996_priv *wm8996) static void wm8996_free_gpio(struct wm8996_priv *wm8996)
{ {
int ret; gpiochip_remove(&wm8996->gpio_chip);
ret = gpiochip_remove(&wm8996->gpio_chip);
if (ret != 0)
dev_err(wm8996->dev, "Failed to remove GPIOs: %d\n", ret);
} }
#else #else
static void wm8996_init_gpio(struct wm8996_priv *wm8996) static void wm8996_init_gpio(struct wm8996_priv *wm8996)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册