summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-max730x.c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2021-10-12 18:39:27 +0300
committerBartosz Golaszewski <brgl@bgdev.pl>2021-10-13 20:52:26 +0300
commit06de2cd788bfa3b51137e9bd471d68029ab68103 (patch)
tree8a1042de7ffc0b9997891a17c0f1555f67145eb2 /drivers/gpio/gpio-max730x.c
parentaa4858eb8264358e9c18c3ad79d6ab4fdc71e0c2 (diff)
downloadlinux-06de2cd788bfa3b51137e9bd471d68029ab68103.tar.xz
gpio: max730x: Make __max730x_remove() return void
An spi or i2c remove callback is only called for devices that probed successfully. In this case this implies that __max730x_probe() set a non-NULL driver data. So the check ts == NULL is never true. With this check dropped, __max730x_remove() returns zero unconditionally. Make it return void instead which makes it easier to see in the callers that there is no error to handle. Also the return value of i2c and spi remove callbacks is ignored anyway. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Diffstat (limited to 'drivers/gpio/gpio-max730x.c')
-rw-r--r--drivers/gpio/gpio-max730x.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/gpio/gpio-max730x.c b/drivers/gpio/gpio-max730x.c
index b8c1fe20f49a..bb5cf14ae4c8 100644
--- a/drivers/gpio/gpio-max730x.c
+++ b/drivers/gpio/gpio-max730x.c
@@ -220,18 +220,14 @@ exit_destroy:
}
EXPORT_SYMBOL_GPL(__max730x_probe);
-int __max730x_remove(struct device *dev)
+void __max730x_remove(struct device *dev)
{
struct max7301 *ts = dev_get_drvdata(dev);
- if (ts == NULL)
- return -ENODEV;
-
/* Power down the chip and disable IRQ output */
ts->write(dev, 0x04, 0x00);
gpiochip_remove(&ts->chip);
mutex_destroy(&ts->lock);
- return 0;
}
EXPORT_SYMBOL_GPL(__max730x_remove);