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

hwmon: (adt7x10) Make adt7x10_remove() return void

Up to now adt7x10_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>
Link: https://lore.kernel.org/r/20211011132754.2479853-3-u.kleine-koenig@pengutronix.de
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

authored by

Uwe Kleine-König and committed by
Guenter Roeck
beee7890 8a0c75a1

+6 -5
+2 -1
drivers/hwmon/adt7310.c
··· 90 90 91 91 static int adt7310_spi_remove(struct spi_device *spi) 92 92 { 93 - return adt7x10_remove(&spi->dev, spi->irq); 93 + adt7x10_remove(&spi->dev, spi->irq); 94 + return 0; 94 95 } 95 96 96 97 static const struct spi_device_id adt7310_id[] = {
+2 -1
drivers/hwmon/adt7410.c
··· 50 50 51 51 static int adt7410_i2c_remove(struct i2c_client *client) 52 52 { 53 - return adt7x10_remove(&client->dev, client->irq); 53 + adt7x10_remove(&client->dev, client->irq); 54 + return 0; 54 55 } 55 56 56 57 static const struct i2c_device_id adt7410_ids[] = {
+1 -2
drivers/hwmon/adt7x10.c
··· 444 444 } 445 445 EXPORT_SYMBOL_GPL(adt7x10_probe); 446 446 447 - int adt7x10_remove(struct device *dev, int irq) 447 + void adt7x10_remove(struct device *dev, int irq) 448 448 { 449 449 struct adt7x10_data *data = dev_get_drvdata(dev); 450 450 ··· 457 457 sysfs_remove_group(&dev->kobj, &adt7x10_group); 458 458 if (data->oldconfig != data->config) 459 459 adt7x10_write_byte(dev, ADT7X10_CONFIG, data->oldconfig); 460 - return 0; 461 460 } 462 461 EXPORT_SYMBOL_GPL(adt7x10_remove); 463 462
+1 -1
drivers/hwmon/adt7x10.h
··· 26 26 27 27 int adt7x10_probe(struct device *dev, const char *name, int irq, 28 28 const struct adt7x10_ops *ops); 29 - int adt7x10_remove(struct device *dev, int irq); 29 + void adt7x10_remove(struct device *dev, int irq); 30 30 31 31 #ifdef CONFIG_PM_SLEEP 32 32 extern const struct dev_pm_ops adt7x10_dev_pm_ops;