iio:magnetometer:mbc150: Make bmc150_magn_remove() return void
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Sat, 14 May 2022 13:32:50 +0000 (15:32 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 11 Jun 2022 13:35:27 +0000 (14:35 +0100)
bmc150_magn_remove() always returns zero. Make it return no value which
makes it easier to see in the callers that there is no error to handle.

Also the return value of i2c driver remove callbacks is ignored anyway.
This prepares making i2c remove callbacks return void, too.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20220514133250.307955-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/magnetometer/bmc150_magn.c
drivers/iio/magnetometer/bmc150_magn.h
drivers/iio/magnetometer/bmc150_magn_i2c.c

index 64e8b04..06d5a1e 100644 (file)
@@ -985,7 +985,7 @@ err_poweroff:
 }
 EXPORT_SYMBOL_NS(bmc150_magn_probe, IIO_BMC150_MAGN);
 
-int bmc150_magn_remove(struct device *dev)
+void bmc150_magn_remove(struct device *dev)
 {
        struct iio_dev *indio_dev = dev_get_drvdata(dev);
        struct bmc150_magn_data *data = iio_priv(indio_dev);
@@ -1008,7 +1008,6 @@ int bmc150_magn_remove(struct device *dev)
        mutex_unlock(&data->mutex);
 
        regulator_bulk_disable(ARRAY_SIZE(data->regulators), data->regulators);
-       return 0;
 }
 EXPORT_SYMBOL_NS(bmc150_magn_remove, IIO_BMC150_MAGN);
 
index 3b69232..98c086d 100644 (file)
@@ -7,6 +7,6 @@ extern const struct dev_pm_ops bmc150_magn_pm_ops;
 
 int bmc150_magn_probe(struct device *dev, struct regmap *regmap, int irq,
                      const char *name);
-int bmc150_magn_remove(struct device *dev);
+void bmc150_magn_remove(struct device *dev);
 
 #endif /* _BMC150_MAGN_H_ */
index e39b896..65c0044 100644 (file)
@@ -36,7 +36,9 @@ static int bmc150_magn_i2c_probe(struct i2c_client *client,
 
 static int bmc150_magn_i2c_remove(struct i2c_client *client)
 {
-       return bmc150_magn_remove(&client->dev);
+       bmc150_magn_remove(&client->dev);
+
+       return 0;
 }
 
 static const struct acpi_device_id bmc150_magn_acpi_match[] = {