From aafbf04f958df9d65551946da450f05e2536c45a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Fri, 14 Apr 2023 19:12:35 +0200 Subject: [PATCH] power: reset: gpio-restart: Convert to platform remove callback returning void MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Returning an error code from a remove callback makes the driver core emit a generic (and so little helpful) error message and after that the error code is ignored and the device unbound. As gpio_restart_remove() already emits an error message, suppressing the generic error is no loss. Then convert to .remove_new() which is equivalent to returning 0 unconditionally in .remove(). See commit 5c5a7680e67b ("platform: Provide a remove callback that returns no value") for its rational. Signed-off-by: Uwe Kleine-König Signed-off-by: Sebastian Reichel --- drivers/power/reset/gpio-restart.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/power/reset/gpio-restart.c b/drivers/power/reset/gpio-restart.c index 35d981d..a479d35 100644 --- a/drivers/power/reset/gpio-restart.c +++ b/drivers/power/reset/gpio-restart.c @@ -105,7 +105,7 @@ static int gpio_restart_probe(struct platform_device *pdev) return 0; } -static int gpio_restart_remove(struct platform_device *pdev) +static void gpio_restart_remove(struct platform_device *pdev) { struct gpio_restart *gpio_restart = platform_get_drvdata(pdev); int ret; @@ -115,10 +115,7 @@ static int gpio_restart_remove(struct platform_device *pdev) dev_err(&pdev->dev, "%s: cannot unregister restart handler, %d\n", __func__, ret); - return -ENODEV; } - - return 0; } static const struct of_device_id of_gpio_restart_match[] = { @@ -128,7 +125,7 @@ static const struct of_device_id of_gpio_restart_match[] = { static struct platform_driver gpio_restart_driver = { .probe = gpio_restart_probe, - .remove = gpio_restart_remove, + .remove_new = gpio_restart_remove, .driver = { .name = "restart-gpio", .of_match_table = of_gpio_restart_match, -- 2.7.4