power: reset: gpio-restart: Convert to platform remove callback returning void

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 5c5a7680e6 ("platform:
Provide a remove callback that returns no value") for its rational.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
Uwe Kleine-König 2023-04-14 19:12:35 +02:00 committed by Sebastian Reichel
parent 0262fa1666
commit aafbf04f95

View File

@ -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,