Skip to content

Commit 5ee241f

Browse files
Uwe Kleine-Königgregkh
authored andcommitted
mmc: davinci: Don't strip remove function when driver is builtin
[ Upstream commit 55c421b ] Using __exit for the remove function results in the remove callback being discarded with CONFIG_MMC_DAVINCI=y. When such a device gets unbound (e.g. using sysfs or hotplug), the driver is just removed without the cleanup being performed. This results in resource leaks. Fix it by compiling in the remove callback unconditionally. This also fixes a W=1 modpost warning: WARNING: modpost: drivers/mmc/host/davinci_mmc: section mismatch in reference: davinci_mmcsd_driver+0x10 (section: .data) -> davinci_mmcsd_remove (section: .exit.text) Fixes: b4cff45 ("DaVinci: MMC: MMC/SD controller driver for DaVinci family") Signed-off-by: Uwe Kleine-König <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent c3d39fd commit 5ee241f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/mmc/host/davinci_mmc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,7 +1345,7 @@ static int davinci_mmcsd_probe(struct platform_device *pdev)
13451345
return ret;
13461346
}
13471347

1348-
static int __exit davinci_mmcsd_remove(struct platform_device *pdev)
1348+
static int davinci_mmcsd_remove(struct platform_device *pdev)
13491349
{
13501350
struct mmc_davinci_host *host = platform_get_drvdata(pdev);
13511351

@@ -1402,7 +1402,7 @@ static struct platform_driver davinci_mmcsd_driver = {
14021402
.of_match_table = davinci_mmc_dt_ids,
14031403
},
14041404
.probe = davinci_mmcsd_probe,
1405-
.remove = __exit_p(davinci_mmcsd_remove),
1405+
.remove = davinci_mmcsd_remove,
14061406
.id_table = davinci_mmc_devtype,
14071407
};
14081408

0 commit comments

Comments
 (0)