iio: magn: hmc5843: Make hmc5843_common_remove() return void
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Wed, 13 Oct 2021 20:32:21 +0000 (22:32 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 19 Oct 2021 07:30:45 +0000 (08:30 +0100)
Up to now hmc5843_common_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-14-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/magnetometer/hmc5843.h
drivers/iio/magnetometer/hmc5843_core.c
drivers/iio/magnetometer/hmc5843_i2c.c
drivers/iio/magnetometer/hmc5843_spi.c

index 242f742f2643a67e696b67741188d33685adea7c..9120c8bbf3dd59f5078342a52dda247cddadc893 100644 (file)
@@ -50,7 +50,7 @@ struct hmc5843_data {
 
 int hmc5843_common_probe(struct device *dev, struct regmap *regmap,
                         enum hmc5843_ids id, const char *name);
-int hmc5843_common_remove(struct device *dev);
+void hmc5843_common_remove(struct device *dev);
 
 int hmc5843_common_suspend(struct device *dev);
 int hmc5843_common_resume(struct device *dev);
index cf62057480cfef5305778872e84075b71ff4552e..f08726bf5ec359c6b478ee7e4731ce43abf29602 100644 (file)
@@ -671,7 +671,7 @@ buffer_setup_err:
 }
 EXPORT_SYMBOL(hmc5843_common_probe);
 
-int hmc5843_common_remove(struct device *dev)
+void hmc5843_common_remove(struct device *dev)
 {
        struct iio_dev *indio_dev = dev_get_drvdata(dev);
 
@@ -680,8 +680,6 @@ int hmc5843_common_remove(struct device *dev)
 
        /*  sleep mode to save power */
        hmc5843_set_mode(iio_priv(indio_dev), HMC5843_MODE_SLEEP);
-
-       return 0;
 }
 EXPORT_SYMBOL(hmc5843_common_remove);
 
index 67fe657fdb3e6ef986a1ae4133e655cecaf1579f..bc6e12f1d5213d289537307ef2385a632e4b7630 100644 (file)
@@ -67,7 +67,9 @@ static int hmc5843_i2c_probe(struct i2c_client *cli,
 
 static int hmc5843_i2c_remove(struct i2c_client *client)
 {
-       return hmc5843_common_remove(&client->dev);
+       hmc5843_common_remove(&client->dev);
+
+       return 0;
 }
 
 static const struct i2c_device_id hmc5843_id[] = {
index d827554c346e2cebcacd0217b2870aa7935036dc..89cf59a62c289d2294c0cf5ec387bad7de3e0a8e 100644 (file)
@@ -76,7 +76,9 @@ static int hmc5843_spi_probe(struct spi_device *spi)
 
 static int hmc5843_spi_remove(struct spi_device *spi)
 {
-       return hmc5843_common_remove(&spi->dev);
+       hmc5843_common_remove(&spi->dev);
+
+       return 0;
 }
 
 static const struct spi_device_id hmc5843_id[] = {