Skip to content

Commit 127806d

Browse files
Uwe Kleine-KönigKAGA-KOKO
authored andcommitted
irqchip/renesas-irqc: 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> Link: https://lore.kernel.org/r/2d367ab738ed2e4cf58cffc10d64b0cbe8a1322c.1703284359.git.u.kleine-koenig@pengutronix.de
1 parent be5476f commit 127806d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/irqchip/irq-renesas-irqc.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,13 @@ static int irqc_probe(struct platform_device *pdev)
218218
return ret;
219219
}
220220

221-
static int irqc_remove(struct platform_device *pdev)
221+
static void irqc_remove(struct platform_device *pdev)
222222
{
223223
struct irqc_priv *p = platform_get_drvdata(pdev);
224224

225225
irq_domain_remove(p->irq_domain);
226226
pm_runtime_put(&pdev->dev);
227227
pm_runtime_disable(&pdev->dev);
228-
return 0;
229228
}
230229

231230
static int __maybe_unused irqc_suspend(struct device *dev)
@@ -248,11 +247,11 @@ MODULE_DEVICE_TABLE(of, irqc_dt_ids);
248247

249248
static struct platform_driver irqc_device_driver = {
250249
.probe = irqc_probe,
251-
.remove = irqc_remove,
250+
.remove_new = irqc_remove,
252251
.driver = {
253-
.name = "renesas_irqc",
252+
.name = "renesas_irqc",
254253
.of_match_table = irqc_dt_ids,
255-
.pm = &irqc_pm_ops,
254+
.pm = &irqc_pm_ops,
256255
}
257256
};
258257

0 commit comments

Comments
 (0)