Skip to content

Commit 303cbf2

Browse files
Uwe Kleine-Königgregkh
authored andcommitted
firmware: imx-dsp: 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/f4cc1ffe30b837d5eab96f2924f51999dfa9f671.1703693980.git.u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f69583d commit 303cbf2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/firmware/imx/imx-dsp.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ static int imx_dsp_probe(struct platform_device *pdev)
160160
return 0;
161161
}
162162

163-
static int imx_dsp_remove(struct platform_device *pdev)
163+
static void imx_dsp_remove(struct platform_device *pdev)
164164
{
165165
struct imx_dsp_chan *dsp_chan;
166166
struct imx_dsp_ipc *dsp_ipc;
@@ -173,16 +173,14 @@ static int imx_dsp_remove(struct platform_device *pdev)
173173
mbox_free_channel(dsp_chan->ch);
174174
kfree(dsp_chan->name);
175175
}
176-
177-
return 0;
178176
}
179177

180178
static struct platform_driver imx_dsp_driver = {
181179
.driver = {
182180
.name = "imx-dsp",
183181
},
184182
.probe = imx_dsp_probe,
185-
.remove = imx_dsp_remove,
183+
.remove_new = imx_dsp_remove,
186184
};
187185
builtin_platform_driver(imx_dsp_driver);
188186

0 commit comments

Comments
 (0)