mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
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>
This commit is contained in:
parent
2765149273
commit
927e11300d
1 changed files with 2 additions and 4 deletions
|
@ -2820,7 +2820,7 @@ clear_ida:
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int scmi_remove(struct platform_device *pdev)
|
||||
static void scmi_remove(struct platform_device *pdev)
|
||||
{
|
||||
int id;
|
||||
struct scmi_info *info = platform_get_drvdata(pdev);
|
||||
|
@ -2854,8 +2854,6 @@ static int scmi_remove(struct platform_device *pdev)
|
|||
scmi_cleanup_txrx_channels(info);
|
||||
|
||||
ida_free(&scmi_id, info->id);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static ssize_t protocol_version_show(struct device *dev,
|
||||
|
@ -2933,7 +2931,7 @@ static struct platform_driver scmi_driver = {
|
|||
.dev_groups = versions_groups,
|
||||
},
|
||||
.probe = scmi_probe,
|
||||
.remove = scmi_remove,
|
||||
.remove_new = scmi_remove,
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue