Commit aafbf04f authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Sebastian Reichel

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 5c5a7680 ("platform:
Provide a remove callback that returns no value") for its rational.
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 0262fa16
...@@ -105,7 +105,7 @@ static int gpio_restart_probe(struct platform_device *pdev) ...@@ -105,7 +105,7 @@ static int gpio_restart_probe(struct platform_device *pdev)
return 0; 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); struct gpio_restart *gpio_restart = platform_get_drvdata(pdev);
int ret; int ret;
...@@ -115,10 +115,7 @@ static int gpio_restart_remove(struct platform_device *pdev) ...@@ -115,10 +115,7 @@ static int gpio_restart_remove(struct platform_device *pdev)
dev_err(&pdev->dev, dev_err(&pdev->dev,
"%s: cannot unregister restart handler, %d\n", "%s: cannot unregister restart handler, %d\n",
__func__, ret); __func__, ret);
return -ENODEV;
} }
return 0;
} }
static const struct of_device_id of_gpio_restart_match[] = { static const struct of_device_id of_gpio_restart_match[] = {
...@@ -128,7 +125,7 @@ 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 = { static struct platform_driver gpio_restart_driver = {
.probe = gpio_restart_probe, .probe = gpio_restart_probe,
.remove = gpio_restart_remove, .remove_new = gpio_restart_remove,
.driver = { .driver = {
.name = "restart-gpio", .name = "restart-gpio",
.of_match_table = of_gpio_restart_match, .of_match_table = of_gpio_restart_match,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment