iio: accel: bmc150: Make bmc150_accel_core_remove() return void
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Wed, 13 Oct 2021 20:32:10 +0000 (22:32 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 19 Oct 2021 07:30:45 +0000 (08:30 +0100)
Up to now bmc150_accel_core_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-3-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/bmc150-accel-core.c
drivers/iio/accel/bmc150-accel-i2c.c
drivers/iio/accel/bmc150-accel-spi.c
drivers/iio/accel/bmc150-accel.h

index 63216321cdb51927b43152b9a67a990e4e2683f4..b0678c351e829336b891441d499cfac59b2fc04d 100644 (file)
@@ -1800,7 +1800,7 @@ err_disable_regulators:
 }
 EXPORT_SYMBOL_GPL(bmc150_accel_core_probe);
 
-int bmc150_accel_core_remove(struct device *dev)
+void bmc150_accel_core_remove(struct device *dev)
 {
        struct iio_dev *indio_dev = dev_get_drvdata(dev);
        struct bmc150_accel_data *data = iio_priv(indio_dev);
@@ -1820,8 +1820,6 @@ int bmc150_accel_core_remove(struct device *dev)
 
        regulator_bulk_disable(ARRAY_SIZE(data->regulators),
                               data->regulators);
-
-       return 0;
 }
 EXPORT_SYMBOL_GPL(bmc150_accel_core_remove);
 
index 88bd8a25f142bda04d1e9ac659d8b9aaaa56de5d..9e52df9a8f07795694d0f392d23207049a3fd0fa 100644 (file)
@@ -213,7 +213,9 @@ static int bmc150_accel_remove(struct i2c_client *client)
 {
        bmc150_acpi_dual_accel_remove(client);
 
-       return bmc150_accel_core_remove(&client->dev);
+       bmc150_accel_core_remove(&client->dev);
+
+       return 0;
 }
 
 static const struct acpi_device_id bmc150_accel_acpi_match[] = {
index 191e312dc91a7303ac3510c204f601c387abdb1f..11559567cb398dcfaee86e05ff6a1f0eba2c4218 100644 (file)
@@ -37,7 +37,9 @@ static int bmc150_accel_probe(struct spi_device *spi)
 
 static int bmc150_accel_remove(struct spi_device *spi)
 {
-       return bmc150_accel_core_remove(&spi->dev);
+       bmc150_accel_core_remove(&spi->dev);
+
+       return 0;
 }
 
 static const struct acpi_device_id bmc150_accel_acpi_match[] = {
index 1bb5023e8ed9cfc3dd3a9e463503a1bdf7df73e9..7775c5edaeefd464ead77e9ced917b89f576feea 100644 (file)
@@ -88,7 +88,7 @@ struct bmc150_accel_data {
 int bmc150_accel_core_probe(struct device *dev, struct regmap *regmap, int irq,
                            enum bmc150_type type, const char *name,
                            bool block_supported);
-int bmc150_accel_core_remove(struct device *dev);
+void bmc150_accel_core_remove(struct device *dev);
 extern const struct dev_pm_ops bmc150_accel_pm_ops;
 extern const struct regmap_config bmc150_regmap_conf;