Skip to content

Commit 4b1d88f

Browse files
Uwe Kleine-Königdamien-lemoal
authored andcommitted
ata: pata_pxa: 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 b5ba32b commit 4b1d88f

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/ata/pata_pxa.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,21 +295,19 @@ static int pxa_ata_probe(struct platform_device *pdev)
295295
return ret;
296296
}
297297

298-
static int pxa_ata_remove(struct platform_device *pdev)
298+
static void pxa_ata_remove(struct platform_device *pdev)
299299
{
300300
struct ata_host *host = platform_get_drvdata(pdev);
301301
struct pata_pxa_data *data = host->ports[0]->private_data;
302302

303303
dma_release_channel(data->dma_chan);
304304

305305
ata_host_detach(host);
306-
307-
return 0;
308306
}
309307

310308
static struct platform_driver pxa_ata_driver = {
311309
.probe = pxa_ata_probe,
312-
.remove = pxa_ata_remove,
310+
.remove_new = pxa_ata_remove,
313311
.driver = {
314312
.name = DRV_NAME,
315313
},

0 commit comments

Comments
 (0)