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

index a06dae5c971d4e8fcce6c390fa5179659af9ad8e..d74465214feb85e33ecc88539945a6506ac45500 100644 (file)
@@ -536,7 +536,7 @@ int bmi088_accel_core_probe(struct device *dev, struct regmap *regmap,
 EXPORT_SYMBOL_GPL(bmi088_accel_core_probe);
 
 
-int bmi088_accel_core_remove(struct device *dev)
+void bmi088_accel_core_remove(struct device *dev)
 {
        struct iio_dev *indio_dev = dev_get_drvdata(dev);
        struct bmi088_accel_data *data = iio_priv(indio_dev);
@@ -546,8 +546,6 @@ int bmi088_accel_core_remove(struct device *dev)
        pm_runtime_disable(dev);
        pm_runtime_set_suspended(dev);
        bmi088_accel_power_down(data);
-
-       return 0;
 }
 EXPORT_SYMBOL_GPL(bmi088_accel_core_remove);
 
index dd1e3f6cf211173607ccf72555f6f9aaaf54376f..758ad2f128962b37de2027669b0ae2c1ecacdd96 100644 (file)
@@ -58,7 +58,9 @@ static int bmi088_accel_probe(struct spi_device *spi)
 
 static int bmi088_accel_remove(struct spi_device *spi)
 {
-       return bmi088_accel_core_remove(&spi->dev);
+       bmi088_accel_core_remove(&spi->dev);
+
+       return 0;
 }
 
 static const struct spi_device_id bmi088_accel_id[] = {
index 5c25f16b672c961c59b18a4332b151f381fc8e21..5d40c7cf1cbcac395045b0b0650c7c1629bc2116 100644 (file)
@@ -13,6 +13,6 @@ extern const struct dev_pm_ops bmi088_accel_pm_ops;
 
 int bmi088_accel_core_probe(struct device *dev, struct regmap *regmap, int irq,
                            const char *name, bool block_supported);
-int bmi088_accel_core_remove(struct device *dev);
+void bmi088_accel_core_remove(struct device *dev);
 
 #endif /* BMI088_ACCEL_H */