iio: pressure: ms5611: Make ms5611_remove() return void
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Wed, 13 Oct 2021 20:32:23 +0000 (22:32 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 19 Oct 2021 07:30:46 +0000 (08:30 +0100)
Up to now ms5611_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-16-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/pressure/ms5611.h
drivers/iio/pressure/ms5611_core.c
drivers/iio/pressure/ms5611_i2c.c
drivers/iio/pressure/ms5611_spi.c

index bc06271fa38bc95f8b1f14e2fdb27041e24c6560..86b1c4b1820da358e335dff3cb766fef2dcd1c0c 100644 (file)
@@ -61,6 +61,6 @@ struct ms5611_state {
 
 int ms5611_probe(struct iio_dev *indio_dev, struct device *dev,
                 const char *name, int type);
-int ms5611_remove(struct iio_dev *indio_dev);
+void ms5611_remove(struct iio_dev *indio_dev);
 
 #endif /* _MS5611_H */
index 214b0d25f59804ba499a679482e69e6ab3c91ce4..ee75f08655c9edf80394e3bbf2464b24be535690 100644 (file)
@@ -474,13 +474,11 @@ err_fini:
 }
 EXPORT_SYMBOL(ms5611_probe);
 
-int ms5611_remove(struct iio_dev *indio_dev)
+void ms5611_remove(struct iio_dev *indio_dev)
 {
        iio_device_unregister(indio_dev);
        iio_triggered_buffer_cleanup(indio_dev);
        ms5611_fini(indio_dev);
-
-       return 0;
 }
 EXPORT_SYMBOL(ms5611_remove);
 
index 7c04f730430c7aa02c7cf02c13f328a735065285..5c82d80f85b65a987daeb9e8910ba95055825b7c 100644 (file)
@@ -110,7 +110,9 @@ static int ms5611_i2c_probe(struct i2c_client *client,
 
 static int ms5611_i2c_remove(struct i2c_client *client)
 {
-       return ms5611_remove(i2c_get_clientdata(client));
+       ms5611_remove(i2c_get_clientdata(client));
+
+       return 0;
 }
 
 static const struct of_device_id ms5611_i2c_matches[] = {
index 45d3a7d5be8e4e637b7acc9c563c1ede7b22e43f..79bed64c9b688186b0bf2bdc288fe341f1332be6 100644 (file)
@@ -112,7 +112,9 @@ static int ms5611_spi_probe(struct spi_device *spi)
 
 static int ms5611_spi_remove(struct spi_device *spi)
 {
-       return ms5611_remove(spi_get_drvdata(spi));
+       ms5611_remove(spi_get_drvdata(spi));
+
+       return 0;
 }
 
 static const struct of_device_id ms5611_spi_matches[] = {