From fc7a6209d5710618eb4f72a77cd81b8d694ecf89 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Tue, 13 Jul 2021 21:35:22 +0200 Subject: bus: Make remove callback return void MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The driver core ignores the return value of this callback because there is only little it can do when a device disappears. This is the final bit of a long lasting cleanup quest where several buses were converted to also return void from their remove callback. Additionally some resource leaks were fixed that were caused by drivers returning an error code in the expectation that the driver won't go away. With struct bus_type::remove returning void it's prevented that newly implemented buses return an ignored error code and so don't anticipate wrong expectations for driver authors. Reviewed-by: Tom Rix (For fpga) Reviewed-by: Mathieu Poirier Reviewed-by: Cornelia Huck (For drivers/s390 and drivers/vfio) Acked-by: Russell King (Oracle) (For ARM, Amba and related parts) Acked-by: Mark Brown Acked-by: Chen-Yu Tsai (for sunxi-rsb) Acked-by: Pali Rohár Acked-by: Mauro Carvalho Chehab (for media) Acked-by: Hans de Goede (For drivers/platform) Acked-by: Alexandre Belloni Acked-By: Vinod Koul Acked-by: Juergen Gross (For xen) Acked-by: Lee Jones (For mfd) Acked-by: Johannes Thumshirn (For mcb) Acked-by: Johan Hovold Acked-by: Srinivas Kandagatla (For slimbus) Acked-by: Kirti Wankhede (For vfio) Acked-by: Maximilian Luz Acked-by: Heikki Krogerus (For ulpi and typec) Acked-by: Samuel Iglesias Gonsálvez (For ipack) Acked-by: Geoff Levand (For ps3) Acked-by: Yehezkel Bernat (For thunderbolt) Acked-by: Alexander Shishkin (For intel_th) Acked-by: Dominik Brodowski (For pcmcia) Acked-by: Rafael J. Wysocki (For ACPI) Acked-by: Bjorn Andersson (rpmsg and apr) Acked-by: Srinivas Pandruvada (For intel-ish-hid) Acked-by: Dan Williams (For CXL, DAX, and NVDIMM) Acked-by: William Breathitt Gray (For isa) Acked-by: Stefan Richter (For firewire) Acked-by: Benjamin Tissoires (For hid) Acked-by: Thorsten Scherer (For siox) Acked-by: Sven Van Asbroeck (For anybuss) Acked-by: Ulf Hansson (For MMC) Acked-by: Wolfram Sang # for I2C Acked-by: Sudeep Holla Acked-by: Geert Uytterhoeven Acked-by: Dmitry Torokhov Acked-by: Finn Thain Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20210713193522.1770306-6-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman --- sound/ac97/bus.c | 6 ++---- sound/aoa/soundbus/core.c | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'sound') diff --git a/sound/ac97/bus.c b/sound/ac97/bus.c index 6ddf646cda65..0d31a6d71468 100644 --- a/sound/ac97/bus.c +++ b/sound/ac97/bus.c @@ -514,7 +514,7 @@ static int ac97_bus_probe(struct device *dev) return ret; } -static int ac97_bus_remove(struct device *dev) +static void ac97_bus_remove(struct device *dev) { struct ac97_codec_device *adev = to_ac97_device(dev); struct ac97_codec_driver *adrv = to_ac97_driver(dev->driver); @@ -522,7 +522,7 @@ static int ac97_bus_remove(struct device *dev) ret = pm_runtime_resume_and_get(dev); if (ret < 0) - return ret; + return; ret = adrv->remove(adev); pm_runtime_put_noidle(dev); @@ -530,8 +530,6 @@ static int ac97_bus_remove(struct device *dev) ac97_put_disable_clk(adev); pm_runtime_disable(dev); - - return ret; } static struct bus_type ac97_bus_type = { diff --git a/sound/aoa/soundbus/core.c b/sound/aoa/soundbus/core.c index 002fb5bf220b..c9579d97fbab 100644 --- a/sound/aoa/soundbus/core.c +++ b/sound/aoa/soundbus/core.c @@ -104,7 +104,7 @@ static int soundbus_uevent(struct device *dev, struct kobj_uevent_env *env) return retval; } -static int soundbus_device_remove(struct device *dev) +static void soundbus_device_remove(struct device *dev) { struct soundbus_dev * soundbus_dev = to_soundbus_device(dev); struct soundbus_driver * drv = to_soundbus_driver(dev->driver); @@ -112,8 +112,6 @@ static int soundbus_device_remove(struct device *dev) if (dev->driver && drv->remove) drv->remove(soundbus_dev); soundbus_dev_put(soundbus_dev); - - return 0; } static void soundbus_device_shutdown(struct device *dev) -- cgit