Skip to content

Commit d1c762d

Browse files
Uwe Kleine-KönigKAGA-KOKO
authored andcommitted
irqchip/renesas-rza1: 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/1a80e31525d0b02063d2ff1baaaa5e87418f54b6.1703284359.git.u.kleine-koenig@pengutronix.de
1 parent 127806d commit d1c762d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/irqchip/irq-renesas-rza1.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,12 +244,11 @@ static int rza1_irqc_probe(struct platform_device *pdev)
244244
return ret;
245245
}
246246

247-
static int rza1_irqc_remove(struct platform_device *pdev)
247+
static void rza1_irqc_remove(struct platform_device *pdev)
248248
{
249249
struct rza1_irqc_priv *priv = platform_get_drvdata(pdev);
250250

251251
irq_domain_remove(priv->irq_domain);
252-
return 0;
253252
}
254253

255254
static const struct of_device_id rza1_irqc_dt_ids[] = {
@@ -260,9 +259,9 @@ MODULE_DEVICE_TABLE(of, rza1_irqc_dt_ids);
260259

261260
static struct platform_driver rza1_irqc_device_driver = {
262261
.probe = rza1_irqc_probe,
263-
.remove = rza1_irqc_remove,
262+
.remove_new = rza1_irqc_remove,
264263
.driver = {
265-
.name = "renesas_rza1_irqc",
264+
.name = "renesas_rza1_irqc",
266265
.of_match_table = rza1_irqc_dt_ids,
267266
}
268267
};

0 commit comments

Comments
 (0)