Skip to content

Commit 8d0f3e7

Browse files
Uwe Kleine-KönigKAGA-KOKO
authored andcommitted
irqchip/madera: Convert to platform_driver::remove_new() callback
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/64c2f79760c53f29651e7126418c407ff699317d.1703284359.git.u.kleine-koenig@pengutronix.de
1 parent f62c5be commit 8d0f3e7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/irqchip/irq-madera.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ static int madera_irq_probe(struct platform_device *pdev)
222222
return 0;
223223
}
224224

225-
static int madera_irq_remove(struct platform_device *pdev)
225+
static void madera_irq_remove(struct platform_device *pdev)
226226
{
227227
struct madera *madera = dev_get_drvdata(pdev->dev.parent);
228228

@@ -232,13 +232,11 @@ static int madera_irq_remove(struct platform_device *pdev)
232232
*/
233233
madera->irq_dev = NULL;
234234
regmap_del_irq_chip(madera->irq, madera->irq_data);
235-
236-
return 0;
237235
}
238236

239237
static struct platform_driver madera_irq_driver = {
240-
.probe = &madera_irq_probe,
241-
.remove = &madera_irq_remove,
238+
.probe = madera_irq_probe,
239+
.remove_new = madera_irq_remove,
242240
.driver = {
243241
.name = "madera-irq",
244242
.pm = &madera_irq_pm_ops,

0 commit comments

Comments
 (0)