Skip to content

Commit 935603e

Browse files
Uwe Kleine-KönigKAGA-KOKO
authored andcommitted
irqchip/stm32-exti: 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: Antonio Borneo <antonio.borneo@foss.st.com> Link: https://lore.kernel.org/r/ac551b89025bafadce05102b94596f8cd3564a32.1703284359.git.u.kleine-koenig@pengutronix.de
1 parent d1c762d commit 935603e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/irqchip/irq-stm32-exti.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -898,10 +898,9 @@ static void stm32_exti_remove_irq(void *data)
898898
irq_domain_remove(domain);
899899
}
900900

901-
static int stm32_exti_remove(struct platform_device *pdev)
901+
static void stm32_exti_remove(struct platform_device *pdev)
902902
{
903903
stm32_exti_h_syscore_deinit();
904-
return 0;
905904
}
906905

907906
static int stm32_exti_probe(struct platform_device *pdev)
@@ -991,10 +990,10 @@ MODULE_DEVICE_TABLE(of, stm32_exti_ids);
991990

992991
static struct platform_driver stm32_exti_driver = {
993992
.probe = stm32_exti_probe,
994-
.remove = stm32_exti_remove,
993+
.remove_new = stm32_exti_remove,
995994
.driver = {
996-
.name = "stm32_exti",
997-
.of_match_table = stm32_exti_ids,
995+
.name = "stm32_exti",
996+
.of_match_table = stm32_exti_ids,
998997
},
999998
};
1000999

0 commit comments

Comments
 (0)