Commit 3c15e00e authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Lee Jones
Browse files

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: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: default avatarChen-Yu Tsai <wens@csie.org>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 5c8fe583
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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 = {
+3 −1
Original line number Diff line number Diff line
@@ -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
+2 −2
Original line number Diff line number Diff line
@@ -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[] = {
+1 −3
Original line number Diff line number Diff line
@@ -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);

+1 −1
Original line number Diff line number Diff line
@@ -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 */
Loading