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

iio: accel: kxsd9: Make kxsd9_common_remove() return void

Up to now kxsd9_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-5-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
df2171c6 bcf9d61a

+8 -6
+3 -1
drivers/iio/accel/kxsd9-i2c.c
··· 34 34 35 35 static int kxsd9_i2c_remove(struct i2c_client *client) 36 36 { 37 - return kxsd9_common_remove(&client->dev); 37 + kxsd9_common_remove(&client->dev); 38 + 39 + return 0; 38 40 } 39 41 40 42 static const struct of_device_id kxsd9_of_match[] = {
+3 -1
drivers/iio/accel/kxsd9-spi.c
··· 34 34 35 35 static int kxsd9_spi_remove(struct spi_device *spi) 36 36 { 37 - return kxsd9_common_remove(&spi->dev); 37 + kxsd9_common_remove(&spi->dev); 38 + 39 + return 0; 38 40 } 39 41 40 42 static const struct spi_device_id kxsd9_spi_id[] = {
+1 -3
drivers/iio/accel/kxsd9.c
··· 478 478 } 479 479 EXPORT_SYMBOL(kxsd9_common_probe); 480 480 481 - int kxsd9_common_remove(struct device *dev) 481 + void kxsd9_common_remove(struct device *dev) 482 482 { 483 483 struct iio_dev *indio_dev = dev_get_drvdata(dev); 484 484 struct kxsd9_state *st = iio_priv(indio_dev); ··· 489 489 pm_runtime_put_noidle(dev); 490 490 pm_runtime_disable(dev); 491 491 kxsd9_power_down(st); 492 - 493 - return 0; 494 492 } 495 493 EXPORT_SYMBOL(kxsd9_common_remove); 496 494
+1 -1
drivers/iio/accel/kxsd9.h
··· 8 8 int kxsd9_common_probe(struct device *dev, 9 9 struct regmap *map, 10 10 const char *name); 11 - int kxsd9_common_remove(struct device *dev); 11 + void kxsd9_common_remove(struct device *dev); 12 12 13 13 extern const struct dev_pm_ops kxsd9_dev_pm_ops;