diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2023-05-18 01:02:32 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-05-28 12:38:02 +0100 |
commit | 08cfceeeea1eebfe70b02d8f411398347a9a711d (patch) | |
tree | c3fe450aa02862ba66ecf52a68cca72b6f5c4501 /drivers/usb/typec/mux | |
parent | 61b013f9e1f7b82a5fd45949ce8d3ac3874cc287 (diff) | |
download | linux-stable-08cfceeeea1eebfe70b02d8f411398347a9a711d.tar.gz linux-stable-08cfceeeea1eebfe70b02d8f411398347a9a711d.tar.bz2 linux-stable-08cfceeeea1eebfe70b02d8f411398347a9a711d.zip |
usb: typec: mux: gpio-sbu: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart from
emitting a warning) and this typically results in resource leaks. To improve
here there is a quest to make the remove callback return void. In the first
step of this quest all drivers are converted to .remove_new() which already
returns void. Eventually after all drivers are converted, .remove_new() is
renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20230517230239.187727-91-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/typec/mux')
-rw-r--r-- | drivers/usb/typec/mux/gpio-sbu-mux.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/usb/typec/mux/gpio-sbu-mux.c b/drivers/usb/typec/mux/gpio-sbu-mux.c index c07856069d43..ad60fd4e8431 100644 --- a/drivers/usb/typec/mux/gpio-sbu-mux.c +++ b/drivers/usb/typec/mux/gpio-sbu-mux.c @@ -137,7 +137,7 @@ static int gpio_sbu_mux_probe(struct platform_device *pdev) return 0; } -static int gpio_sbu_mux_remove(struct platform_device *pdev) +static void gpio_sbu_mux_remove(struct platform_device *pdev) { struct gpio_sbu_mux *sbu_mux = platform_get_drvdata(pdev); @@ -145,8 +145,6 @@ static int gpio_sbu_mux_remove(struct platform_device *pdev) typec_mux_unregister(sbu_mux->mux); typec_switch_unregister(sbu_mux->sw); - - return 0; } static const struct of_device_id gpio_sbu_mux_match[] = { @@ -157,7 +155,7 @@ MODULE_DEVICE_TABLE(of, gpio_sbu_mux_match); static struct platform_driver gpio_sbu_mux_driver = { .probe = gpio_sbu_mux_probe, - .remove = gpio_sbu_mux_remove, + .remove_new = gpio_sbu_mux_remove, .driver = { .name = "gpio_sbu_mux", .of_match_table = gpio_sbu_mux_match, |