Message ID | 20201126074124.1753528-1-u.kleine-koenig@pengutronix.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | bus: sunxi-rsb: make remove callback return void | expand |
On Thu, Nov 26, 2020 at 3:41 PM Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote: > > 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> Looks good to me. Reviewed-by: Chen-Yu Tsai <wens@csie.org> Since this touches the mfd tree as well, we either need an Ack from Lee, the mfd maintainer (CC-ed), or let Lee take it in his tree. For the latter, Acked-by: Chen-Yu Tsai <wens@csie.org> AFAIK we (sunxi) don't have anything regarding RSB queued up, so there won't be any conflicts. Regards ChenYu
On Thu, 26 Nov 2020, Chen-Yu Tsai wrote: > On Thu, Nov 26, 2020 at 3:41 PM Uwe Kleine-König > <u.kleine-koenig@pengutronix.de> wrote: > > > > 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> > > Looks good to me. > > Reviewed-by: Chen-Yu Tsai <wens@csie.org> > > Since this touches the mfd tree as well, we either need an Ack from Lee, > the mfd maintainer (CC-ed), or let Lee take it in his tree. For the latter, Right. Thank you Chen-Yu. Uwe, did you run get_maintainer.pl? Please re-submit this with the proper people on Cc. > Acked-by: Chen-Yu Tsai <wens@csie.org> > > AFAIK we (sunxi) don't have anything regarding RSB queued up, so there > won't be any conflicts.
On Thu, Nov 26, 2020 at 08:03:16AM +0000, Lee Jones wrote: > On Thu, 26 Nov 2020, Chen-Yu Tsai wrote: > > > On Thu, Nov 26, 2020 at 3:41 PM Uwe Kleine-König > > <u.kleine-koenig@pengutronix.de> wrote: > > > > > > 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> > > > > Looks good to me. > > > > Reviewed-by: Chen-Yu Tsai <wens@csie.org> > > > > Since this touches the mfd tree as well, we either need an Ack from Lee, > > the mfd maintainer (CC-ed), or let Lee take it in his tree. For the latter, > > Right. Thank you Chen-Yu. > > Uwe, did you run get_maintainer.pl? I thought I did, but obviously I somehow failed. (I have an idea what went wrong, but I spare you the details.) > Please re-submit this with the proper people on Cc. sure, sorry for my confusion. Best regards Uwe
diff --git a/drivers/bus/sunxi-rsb.c b/drivers/bus/sunxi-rsb.c index 1bb00a959c67..117716e23ffb 100644 --- a/drivers/bus/sunxi-rsb.c +++ b/drivers/bus/sunxi-rsb.c @@ -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 = { diff --git a/drivers/mfd/axp20x-i2c.c b/drivers/mfd/axp20x-i2c.c index 068e9c083f13..743e8338b0db 100644 --- a/drivers/mfd/axp20x-i2c.c +++ b/drivers/mfd/axp20x-i2c.c @@ -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; } static const struct of_device_id axp20x_i2c_of_match[] = { diff --git a/drivers/mfd/axp20x-rsb.c b/drivers/mfd/axp20x-rsb.c index 4cdc79f5cc48..214bc0d84d44 100644 --- a/drivers/mfd/axp20x-rsb.c +++ b/drivers/mfd/axp20x-rsb.c @@ -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[] = { diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c index aa59496e4376..3eae04e24ac8 100644 --- a/drivers/mfd/axp20x.c +++ b/drivers/mfd/axp20x.c @@ -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); diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h index fd5957c042da..9ab0e2fca7ea 100644 --- a/include/linux/mfd/axp20x.h +++ b/include/linux/mfd/axp20x.h @@ -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 */ diff --git a/include/linux/sunxi-rsb.h b/include/linux/sunxi-rsb.h index 7e75bb0346d0..bf0d365f471c 100644 --- a/include/linux/sunxi-rsb.h +++ b/include/linux/sunxi-rsb.h @@ -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)
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> --- drivers/bus/sunxi-rsb.c | 4 +++- drivers/mfd/axp20x-i2c.c | 4 +++- drivers/mfd/axp20x-rsb.c | 4 ++-- drivers/mfd/axp20x.c | 4 +--- include/linux/mfd/axp20x.h | 2 +- include/linux/sunxi-rsb.h | 2 +- 6 files changed, 11 insertions(+), 9 deletions(-)