mfd/bus: sunxi-rsb: Make .remove() callback return void
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 26 Nov 2020 10:41:42 +0000 (11:41 +0100)
committerLee Jones <lee.jones@linaro.org>
Fri, 15 Jan 2021 13:23:36 +0000 (13:23 +0000)
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>
drivers/bus/sunxi-rsb.c
drivers/mfd/axp20x-i2c.c
drivers/mfd/axp20x-rsb.c
drivers/mfd/axp20x.c
include/linux/mfd/axp20x.h
include/linux/sunxi-rsb.h

index 1bb00a959c67f28c15b0928cb70a4f44237acffc..117716e23ffb6db8c11ad3996fa1a9abd545cbf2 100644 (file)
@@ -170,7 +170,9 @@ static int sunxi_rsb_device_remove(struct device *dev)
 {
        const struct sunxi_rsb_driver *drv = to_sunxi_rsb_driver(dev->driver);
 
-       return drv->remove(to_sunxi_rsb_device(dev));
+       drv->remove(to_sunxi_rsb_device(dev));
+
+       return 0;
 }
 
 static struct bus_type sunxi_rsb_bus = {
index 2cfde81f5fbfeb70685ce0153dcd730f37c017a8..00ab48018d8d2e4dcf934ded988f89c960c92e7d 100644 (file)
@@ -54,7 +54,9 @@ static int axp20x_i2c_remove(struct i2c_client *i2c)
 {
        struct axp20x_dev *axp20x = i2c_get_clientdata(i2c);
 
-       return axp20x_device_remove(axp20x);
+       axp20x_device_remove(axp20x);
+
+       return 0;
 }
 
 #ifdef CONFIG_OF
index 4cdc79f5cc486dffd6ae8677aafaa6fad21810b6..214bc0d84d44cc369f5bdfb2c5b61773d15440fa 100644 (file)
@@ -49,11 +49,11 @@ static int axp20x_rsb_probe(struct sunxi_rsb_device *rdev)
        return axp20x_device_probe(axp20x);
 }
 
-static int axp20x_rsb_remove(struct sunxi_rsb_device *rdev)
+static void axp20x_rsb_remove(struct sunxi_rsb_device *rdev)
 {
        struct axp20x_dev *axp20x = sunxi_rsb_device_get_drvdata(rdev);
 
-       return axp20x_device_remove(axp20x);
+       axp20x_device_remove(axp20x);
 }
 
 static const struct of_device_id axp20x_rsb_of_match[] = {
index aa59496e43768961f2564a72613832af4d180cf7..3eae04e24ac83bbef8479e587c0e113db9c022f4 100644 (file)
@@ -987,7 +987,7 @@ int axp20x_device_probe(struct axp20x_dev *axp20x)
 }
 EXPORT_SYMBOL(axp20x_device_probe);
 
-int axp20x_device_remove(struct axp20x_dev *axp20x)
+void axp20x_device_remove(struct axp20x_dev *axp20x)
 {
        if (axp20x == axp20x_pm_power_off) {
                axp20x_pm_power_off = NULL;
@@ -996,8 +996,6 @@ int axp20x_device_remove(struct axp20x_dev *axp20x)
 
        mfd_remove_devices(axp20x->dev);
        regmap_del_irq_chip(axp20x->irq, axp20x->regmap_irqc);
-
-       return 0;
 }
 EXPORT_SYMBOL(axp20x_device_remove);
 
index fd5957c042da6e6d8083c55c4eba659b5442d36a..9ab0e2fca7eac247590d04598e50850b77011481 100644 (file)
@@ -696,6 +696,6 @@ int axp20x_device_probe(struct axp20x_dev *axp20x);
  *
  * This tells the axp20x core to remove the associated mfd devices
  */
-int axp20x_device_remove(struct axp20x_dev *axp20x);
+void axp20x_device_remove(struct axp20x_dev *axp20x);
 
 #endif /* __LINUX_MFD_AXP20X_H */
index 7e75bb0346d098c82799ca0b61702aea16671e68..bf0d365f471c1eb82ac48d28876a5a8cd9326e06 100644 (file)
@@ -59,7 +59,7 @@ static inline void sunxi_rsb_device_set_drvdata(struct sunxi_rsb_device *rdev,
 struct sunxi_rsb_driver {
        struct device_driver driver;
        int (*probe)(struct sunxi_rsb_device *rdev);
-       int (*remove)(struct sunxi_rsb_device *rdev);
+       void (*remove)(struct sunxi_rsb_device *rdev);
 };
 
 static inline struct sunxi_rsb_driver *to_sunxi_rsb_driver(struct device_driver *d)