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

mfd/bus: sunxi-rsb: Make .remove() callback return void

The driver core ignores the return value of struct device_driver::remove
because there is only little that can be done. To simplify the quest to
make this function return void, let struct sunxi_rsb_driver::remove
return void, too. All users already unconditionally return 0, this
commit makes this obvious and ensures future users don't behave
differently. To simplify even further, make axp20x_device_remove()
return void instead of returning 0 unconditionally, too.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Uwe Kleine-König and committed by
Lee Jones
3c15e00e 5c8fe583

+11 -9
+3 -1
drivers/bus/sunxi-rsb.c
··· 170 170 { 171 171 const struct sunxi_rsb_driver *drv = to_sunxi_rsb_driver(dev->driver); 172 172 173 - return drv->remove(to_sunxi_rsb_device(dev)); 173 + drv->remove(to_sunxi_rsb_device(dev)); 174 + 175 + return 0; 174 176 } 175 177 176 178 static struct bus_type sunxi_rsb_bus = {
+3 -1
drivers/mfd/axp20x-i2c.c
··· 54 54 { 55 55 struct axp20x_dev *axp20x = i2c_get_clientdata(i2c); 56 56 57 - return axp20x_device_remove(axp20x); 57 + axp20x_device_remove(axp20x); 58 + 59 + return 0; 58 60 } 59 61 60 62 #ifdef CONFIG_OF
+2 -2
drivers/mfd/axp20x-rsb.c
··· 49 49 return axp20x_device_probe(axp20x); 50 50 } 51 51 52 - static int axp20x_rsb_remove(struct sunxi_rsb_device *rdev) 52 + static void axp20x_rsb_remove(struct sunxi_rsb_device *rdev) 53 53 { 54 54 struct axp20x_dev *axp20x = sunxi_rsb_device_get_drvdata(rdev); 55 55 56 - return axp20x_device_remove(axp20x); 56 + axp20x_device_remove(axp20x); 57 57 } 58 58 59 59 static const struct of_device_id axp20x_rsb_of_match[] = {
+1 -3
drivers/mfd/axp20x.c
··· 987 987 } 988 988 EXPORT_SYMBOL(axp20x_device_probe); 989 989 990 - int axp20x_device_remove(struct axp20x_dev *axp20x) 990 + void axp20x_device_remove(struct axp20x_dev *axp20x) 991 991 { 992 992 if (axp20x == axp20x_pm_power_off) { 993 993 axp20x_pm_power_off = NULL; ··· 996 996 997 997 mfd_remove_devices(axp20x->dev); 998 998 regmap_del_irq_chip(axp20x->irq, axp20x->regmap_irqc); 999 - 1000 - return 0; 1001 999 } 1002 1000 EXPORT_SYMBOL(axp20x_device_remove); 1003 1001
+1 -1
include/linux/mfd/axp20x.h
··· 696 696 * 697 697 * This tells the axp20x core to remove the associated mfd devices 698 698 */ 699 - int axp20x_device_remove(struct axp20x_dev *axp20x); 699 + void axp20x_device_remove(struct axp20x_dev *axp20x); 700 700 701 701 #endif /* __LINUX_MFD_AXP20X_H */
+1 -1
include/linux/sunxi-rsb.h
··· 59 59 struct sunxi_rsb_driver { 60 60 struct device_driver driver; 61 61 int (*probe)(struct sunxi_rsb_device *rdev); 62 - int (*remove)(struct sunxi_rsb_device *rdev); 62 + void (*remove)(struct sunxi_rsb_device *rdev); 63 63 }; 64 64 65 65 static inline struct sunxi_rsb_driver *to_sunxi_rsb_driver(struct device_driver *d)