Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: accel: bmc150: Make bmc150_accel_core_remove() return void

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>

authored by

Uwe Kleine-König and committed by
Jonathan Cameron
9713964f fa0b148e

+8 -6
+1 -3
drivers/iio/accel/bmc150-accel-core.c
··· 1800 1800 } 1801 1801 EXPORT_SYMBOL_GPL(bmc150_accel_core_probe); 1802 1802 1803 - int bmc150_accel_core_remove(struct device *dev) 1803 + void bmc150_accel_core_remove(struct device *dev) 1804 1804 { 1805 1805 struct iio_dev *indio_dev = dev_get_drvdata(dev); 1806 1806 struct bmc150_accel_data *data = iio_priv(indio_dev); ··· 1820 1820 1821 1821 regulator_bulk_disable(ARRAY_SIZE(data->regulators), 1822 1822 data->regulators); 1823 - 1824 - return 0; 1825 1823 } 1826 1824 EXPORT_SYMBOL_GPL(bmc150_accel_core_remove); 1827 1825
+3 -1
drivers/iio/accel/bmc150-accel-i2c.c
··· 213 213 { 214 214 bmc150_acpi_dual_accel_remove(client); 215 215 216 - return bmc150_accel_core_remove(&client->dev); 216 + bmc150_accel_core_remove(&client->dev); 217 + 218 + return 0; 217 219 } 218 220 219 221 static const struct acpi_device_id bmc150_accel_acpi_match[] = {
+3 -1
drivers/iio/accel/bmc150-accel-spi.c
··· 37 37 38 38 static int bmc150_accel_remove(struct spi_device *spi) 39 39 { 40 - return bmc150_accel_core_remove(&spi->dev); 40 + bmc150_accel_core_remove(&spi->dev); 41 + 42 + return 0; 41 43 } 42 44 43 45 static const struct acpi_device_id bmc150_accel_acpi_match[] = {
+1 -1
drivers/iio/accel/bmc150-accel.h
··· 88 88 int bmc150_accel_core_probe(struct device *dev, struct regmap *regmap, int irq, 89 89 enum bmc150_type type, const char *name, 90 90 bool block_supported); 91 - int bmc150_accel_core_remove(struct device *dev); 91 + void bmc150_accel_core_remove(struct device *dev); 92 92 extern const struct dev_pm_ops bmc150_accel_pm_ops; 93 93 extern const struct regmap_config bmc150_regmap_conf; 94 94