Skip to content

Commit eb605fa

Browse files
Uwe Kleine-Königdamien-lemoal
authored andcommitted
ata: pata_imx: 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() is 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> Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
1 parent 2010259 commit eb605fa

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/ata/pata_imx.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ static int pata_imx_probe(struct platform_device *pdev)
203203
return ret;
204204
}
205205

206-
static int pata_imx_remove(struct platform_device *pdev)
206+
static void pata_imx_remove(struct platform_device *pdev)
207207
{
208208
struct ata_host *host = platform_get_drvdata(pdev);
209209
struct pata_imx_priv *priv = host->private_data;
@@ -213,8 +213,6 @@ static int pata_imx_remove(struct platform_device *pdev)
213213
__raw_writel(0, priv->host_regs + PATA_IMX_ATA_INT_EN);
214214

215215
clk_disable_unprepare(priv->clk);
216-
217-
return 0;
218216
}
219217

220218
#ifdef CONFIG_PM_SLEEP
@@ -265,7 +263,7 @@ MODULE_DEVICE_TABLE(of, imx_pata_dt_ids);
265263

266264
static struct platform_driver pata_imx_driver = {
267265
.probe = pata_imx_probe,
268-
.remove = pata_imx_remove,
266+
.remove_new = pata_imx_remove,
269267
.driver = {
270268
.name = DRV_NAME,
271269
.of_match_table = imx_pata_dt_ids,

0 commit comments

Comments
 (0)