Skip to content

Commit a105291

Browse files
Uwe Kleine-Königmiquelraynal
authored andcommitted
mtd: maps: pxa2xx-flash: Convert to platform remove callback returning void
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 <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Acked-by: Tudor Ambarus <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
1 parent 677edf7 commit a105291

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/mtd/maps/pxa2xx-flash.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static int pxa2xx_flash_probe(struct platform_device *pdev)
9898
return 0;
9999
}
100100

101-
static int pxa2xx_flash_remove(struct platform_device *dev)
101+
static void pxa2xx_flash_remove(struct platform_device *dev)
102102
{
103103
struct pxa2xx_flash_info *info = platform_get_drvdata(dev);
104104

@@ -109,7 +109,6 @@ static int pxa2xx_flash_remove(struct platform_device *dev)
109109
if (info->map.cached)
110110
iounmap(info->map.cached);
111111
kfree(info);
112-
return 0;
113112
}
114113

115114
#ifdef CONFIG_PM
@@ -129,7 +128,7 @@ static struct platform_driver pxa2xx_flash_driver = {
129128
.name = "pxa2xx-flash",
130129
},
131130
.probe = pxa2xx_flash_probe,
132-
.remove = pxa2xx_flash_remove,
131+
.remove_new = pxa2xx_flash_remove,
133132
.shutdown = pxa2xx_flash_shutdown,
134133
};
135134

0 commit comments

Comments
 (0)