Skip to content

Commit 775b066

Browse files
Uwe Kleine-Königmartinezjavier
authored andcommitted
drm/shmobile: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 01790d5 commit 775b066

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(shmob_drm_pm_ops,
172172
* Platform driver
173173
*/
174174

175-
static int shmob_drm_remove(struct platform_device *pdev)
175+
static void shmob_drm_remove(struct platform_device *pdev)
176176
{
177177
struct shmob_drm_device *sdev = platform_get_drvdata(pdev);
178178
struct drm_device *ddev = sdev->ddev;
@@ -181,8 +181,6 @@ static int shmob_drm_remove(struct platform_device *pdev)
181181
drm_kms_helper_poll_fini(ddev);
182182
free_irq(sdev->irq, ddev);
183183
drm_dev_put(ddev);
184-
185-
return 0;
186184
}
187185

188186
static int shmob_drm_probe(struct platform_device *pdev)
@@ -288,7 +286,7 @@ static int shmob_drm_probe(struct platform_device *pdev)
288286

289287
static struct platform_driver shmob_drm_platform_driver = {
290288
.probe = shmob_drm_probe,
291-
.remove = shmob_drm_remove,
289+
.remove_new = shmob_drm_remove,
292290
.driver = {
293291
.name = "shmob-drm",
294292
.pm = pm_sleep_ptr(&shmob_drm_pm_ops),

0 commit comments

Comments
 (0)