Skip to content

Commit 843b62f

Browse files
Uwe Kleine-Königdamien-lemoal
authored andcommitted
ata: pata_arasan_cf: 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> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
1 parent 6b4f165 commit 843b62f

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/ata/pata_arasan_cf.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -917,15 +917,13 @@ static int arasan_cf_probe(struct platform_device *pdev)
917917
return ret;
918918
}
919919

920-
static int arasan_cf_remove(struct platform_device *pdev)
920+
static void arasan_cf_remove(struct platform_device *pdev)
921921
{
922922
struct ata_host *host = platform_get_drvdata(pdev);
923923
struct arasan_cf_dev *acdev = host->ports[0]->private_data;
924924

925925
ata_host_detach(host);
926926
cf_exit(acdev);
927-
928-
return 0;
929927
}
930928

931929
#ifdef CONFIG_PM_SLEEP
@@ -966,7 +964,7 @@ MODULE_DEVICE_TABLE(of, arasan_cf_id_table);
966964

967965
static struct platform_driver arasan_cf_driver = {
968966
.probe = arasan_cf_probe,
969-
.remove = arasan_cf_remove,
967+
.remove_new = arasan_cf_remove,
970968
.driver = {
971969
.name = DRIVER_NAME,
972970
.pm = &arasan_cf_pm_ops,

0 commit comments

Comments
 (0)