iio: dac: ad5592r: Make ad5592r_remove() return void
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Wed, 13 Oct 2021 20:32:17 +0000 (22:32 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 19 Oct 2021 07:30:45 +0000 (08:30 +0100)
Up to now ad5592r_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>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Link: https://lore.kernel.org/r/20211013203223.2694577-10-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/dac/ad5592r-base.c
drivers/iio/dac/ad5592r-base.h
drivers/iio/dac/ad5592r.c
drivers/iio/dac/ad5593r.c

index 0405e92b9e8c3f13c08dfe35df9bdf646611fc64..2fcc59728fd6b0a2da2d371b43076dea0275ef2e 100644 (file)
@@ -663,7 +663,7 @@ error_disable_reg:
 }
 EXPORT_SYMBOL_GPL(ad5592r_probe);
 
-int ad5592r_remove(struct device *dev)
+void ad5592r_remove(struct device *dev)
 {
        struct iio_dev *iio_dev = dev_get_drvdata(dev);
        struct ad5592r_state *st = iio_priv(iio_dev);
@@ -674,8 +674,6 @@ int ad5592r_remove(struct device *dev)
 
        if (st->reg)
                regulator_disable(st->reg);
-
-       return 0;
 }
 EXPORT_SYMBOL_GPL(ad5592r_remove);
 
index 23dac2f1ff8a106d3701c41ff2b1c0eae2f8e9dd..2a22ef69199657ea5eb199f34abb7fa22063f1a6 100644 (file)
@@ -71,6 +71,6 @@ struct ad5592r_state {
 
 int ad5592r_probe(struct device *dev, const char *name,
                const struct ad5592r_rw_ops *ops);
-int ad5592r_remove(struct device *dev);
+void ad5592r_remove(struct device *dev);
 
 #endif /* __DRIVERS_IIO_DAC_AD5592R_BASE_H__ */
index 41f6515006681e7867f2bf5c26956be2690f0f6c..6bfd7951e18caa45e9e6c2490a984a7c028dd582 100644 (file)
@@ -132,7 +132,9 @@ static int ad5592r_spi_probe(struct spi_device *spi)
 
 static int ad5592r_spi_remove(struct spi_device *spi)
 {
-       return ad5592r_remove(&spi->dev);
+       ad5592r_remove(&spi->dev);
+
+       return 0;
 }
 
 static const struct spi_device_id ad5592r_spi_ids[] = {
index 5b4df36fdc2ad9a5c559a06d279cdbb60202d230..64dd7a0bddf764d952a626f05eaa04d5dd0e5dfa 100644 (file)
@@ -99,7 +99,9 @@ static int ad5593r_i2c_probe(struct i2c_client *i2c,
 
 static int ad5593r_i2c_remove(struct i2c_client *i2c)
 {
-       return ad5592r_remove(&i2c->dev);
+       ad5592r_remove(&i2c->dev);
+
+       return 0;
 }
 
 static const struct i2c_device_id ad5593r_i2c_ids[] = {