Skip to content

Commit aafbf04

Browse files
Uwe Kleine-Königsre
authored andcommitted
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 5c5a768 ("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>
1 parent 0262fa1 commit aafbf04

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

drivers/power/reset/gpio-restart.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ static int gpio_restart_probe(struct platform_device *pdev)
105105
return 0;
106106
}
107107

108-
static int gpio_restart_remove(struct platform_device *pdev)
108+
static void gpio_restart_remove(struct platform_device *pdev)
109109
{
110110
struct gpio_restart *gpio_restart = platform_get_drvdata(pdev);
111111
int ret;
@@ -115,10 +115,7 @@ static int gpio_restart_remove(struct platform_device *pdev)
115115
dev_err(&pdev->dev,
116116
"%s: cannot unregister restart handler, %d\n",
117117
__func__, ret);
118-
return -ENODEV;
119118
}
120-
121-
return 0;
122119
}
123120

124121
static const struct of_device_id of_gpio_restart_match[] = {
@@ -128,7 +125,7 @@ static const struct of_device_id of_gpio_restart_match[] = {
128125

129126
static struct platform_driver gpio_restart_driver = {
130127
.probe = gpio_restart_probe,
131-
.remove = gpio_restart_remove,
128+
.remove_new = gpio_restart_remove,
132129
.driver = {
133130
.name = "restart-gpio",
134131
.of_match_table = of_gpio_restart_match,

0 commit comments

Comments
 (0)