Skip to content

Commit 927e113

Browse files
Uwe Kleine-Königgregkh
authored andcommitted
firmware: arm_scmi: 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 <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/86165c8ccd0bb47000a29e711102795b36c8df41.1703693980.git.u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 2765149 commit 927e113

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/firmware/arm_scmi/driver.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2820,7 +2820,7 @@ static int scmi_probe(struct platform_device *pdev)
28202820
return ret;
28212821
}
28222822

2823-
static int scmi_remove(struct platform_device *pdev)
2823+
static void scmi_remove(struct platform_device *pdev)
28242824
{
28252825
int id;
28262826
struct scmi_info *info = platform_get_drvdata(pdev);
@@ -2854,8 +2854,6 @@ static int scmi_remove(struct platform_device *pdev)
28542854
scmi_cleanup_txrx_channels(info);
28552855

28562856
ida_free(&scmi_id, info->id);
2857-
2858-
return 0;
28592857
}
28602858

28612859
static ssize_t protocol_version_show(struct device *dev,
@@ -2933,7 +2931,7 @@ static struct platform_driver scmi_driver = {
29332931
.dev_groups = versions_groups,
29342932
},
29352933
.probe = scmi_probe,
2936-
.remove = scmi_remove,
2934+
.remove_new = scmi_remove,
29372935
};
29382936

29392937
/**

0 commit comments

Comments
 (0)