summaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-04-14 19:12:35 +0200
committerSebastian Reichel <sebastian.reichel@collabora.com>2023-05-08 14:41:00 +0200
commitaafbf04f958df9d65551946da450f05e2536c45a (patch)
treebbc830f198cf19a5d93aa22a373e653a9c5b622c /drivers/power
parentdt-bindings: power: reset: convert nvmem-reboot-mode bindings to YAML (diff)
downloadlinux-aafbf04f958df9d65551946da450f05e2536c45a.tar.xz
linux-aafbf04f958df9d65551946da450f05e2536c45a.zip
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 5c5a7680e67b ("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>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/reset/gpio-restart.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/power/reset/gpio-restart.c b/drivers/power/reset/gpio-restart.c
index 35d981d5e6c8..a479d3536eb1 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,