Skip to content

Commit 3095f11

Browse files
Uwe Kleine-Königmartinezjavier
authored andcommitted
drm/imx/ipuv3: 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 the ipuv3 imx drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Signed-off-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 5aa1dfc commit 3095f11

File tree

6 files changed

+12
-20
lines changed

6 files changed

+12
-20
lines changed

drivers/gpu/drm/imx/ipuv3/dw_hdmi-imx.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,19 +255,17 @@ static int dw_hdmi_imx_probe(struct platform_device *pdev)
255255
return ret;
256256
}
257257

258-
static int dw_hdmi_imx_remove(struct platform_device *pdev)
258+
static void dw_hdmi_imx_remove(struct platform_device *pdev)
259259
{
260260
struct imx_hdmi *hdmi = platform_get_drvdata(pdev);
261261

262262
component_del(&pdev->dev, &dw_hdmi_imx_ops);
263263
dw_hdmi_remove(hdmi->hdmi);
264-
265-
return 0;
266264
}
267265

268266
static struct platform_driver dw_hdmi_imx_platform_driver = {
269267
.probe = dw_hdmi_imx_probe,
270-
.remove = dw_hdmi_imx_remove,
268+
.remove_new = dw_hdmi_imx_remove,
271269
.driver = {
272270
.name = "dwhdmi-imx",
273271
.of_match_table = dw_hdmi_imx_dt_ids,

drivers/gpu/drm/imx/ipuv3/imx-drm-core.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,9 @@ static int imx_drm_platform_probe(struct platform_device *pdev)
292292
return ret;
293293
}
294294

295-
static int imx_drm_platform_remove(struct platform_device *pdev)
295+
static void imx_drm_platform_remove(struct platform_device *pdev)
296296
{
297297
component_master_del(&pdev->dev, &imx_drm_ops);
298-
return 0;
299298
}
300299

301300
#ifdef CONFIG_PM_SLEEP
@@ -324,7 +323,7 @@ MODULE_DEVICE_TABLE(of, imx_drm_dt_ids);
324323

325324
static struct platform_driver imx_drm_pdrv = {
326325
.probe = imx_drm_platform_probe,
327-
.remove = imx_drm_platform_remove,
326+
.remove_new = imx_drm_platform_remove,
328327
.driver = {
329328
.name = "imx-drm",
330329
.pm = &imx_drm_pm_ops,

drivers/gpu/drm/imx/ipuv3/imx-ldb.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ static int imx_ldb_probe(struct platform_device *pdev)
737737
return ret;
738738
}
739739

740-
static int imx_ldb_remove(struct platform_device *pdev)
740+
static void imx_ldb_remove(struct platform_device *pdev)
741741
{
742742
struct imx_ldb *imx_ldb = platform_get_drvdata(pdev);
743743
int i;
@@ -750,12 +750,11 @@ static int imx_ldb_remove(struct platform_device *pdev)
750750
}
751751

752752
component_del(&pdev->dev, &imx_ldb_ops);
753-
return 0;
754753
}
755754

756755
static struct platform_driver imx_ldb_driver = {
757756
.probe = imx_ldb_probe,
758-
.remove = imx_ldb_remove,
757+
.remove_new = imx_ldb_remove,
759758
.driver = {
760759
.of_match_table = imx_ldb_dt_ids,
761760
.name = DRIVER_NAME,

drivers/gpu/drm/imx/ipuv3/imx-tve.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -645,10 +645,9 @@ static int imx_tve_probe(struct platform_device *pdev)
645645
return component_add(dev, &imx_tve_ops);
646646
}
647647

648-
static int imx_tve_remove(struct platform_device *pdev)
648+
static void imx_tve_remove(struct platform_device *pdev)
649649
{
650650
component_del(&pdev->dev, &imx_tve_ops);
651-
return 0;
652651
}
653652

654653
static const struct of_device_id imx_tve_dt_ids[] = {
@@ -659,7 +658,7 @@ MODULE_DEVICE_TABLE(of, imx_tve_dt_ids);
659658

660659
static struct platform_driver imx_tve_driver = {
661660
.probe = imx_tve_probe,
662-
.remove = imx_tve_remove,
661+
.remove_new = imx_tve_remove,
663662
.driver = {
664663
.of_match_table = imx_tve_dt_ids,
665664
.name = "imx-tve",

drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,16 +441,15 @@ static int ipu_drm_probe(struct platform_device *pdev)
441441
return component_add(dev, &ipu_crtc_ops);
442442
}
443443

444-
static int ipu_drm_remove(struct platform_device *pdev)
444+
static void ipu_drm_remove(struct platform_device *pdev)
445445
{
446446
component_del(&pdev->dev, &ipu_crtc_ops);
447-
return 0;
448447
}
449448

450449
struct platform_driver ipu_drm_driver = {
451450
.driver = {
452451
.name = "imx-ipuv3-crtc",
453452
},
454453
.probe = ipu_drm_probe,
455-
.remove = ipu_drm_remove,
454+
.remove_new = ipu_drm_remove,
456455
};

drivers/gpu/drm/imx/ipuv3/parallel-display.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,11 +353,9 @@ static int imx_pd_probe(struct platform_device *pdev)
353353
return component_add(dev, &imx_pd_ops);
354354
}
355355

356-
static int imx_pd_remove(struct platform_device *pdev)
356+
static void imx_pd_remove(struct platform_device *pdev)
357357
{
358358
component_del(&pdev->dev, &imx_pd_ops);
359-
360-
return 0;
361359
}
362360

363361
static const struct of_device_id imx_pd_dt_ids[] = {
@@ -368,7 +366,7 @@ MODULE_DEVICE_TABLE(of, imx_pd_dt_ids);
368366

369367
static struct platform_driver imx_pd_driver = {
370368
.probe = imx_pd_probe,
371-
.remove = imx_pd_remove,
369+
.remove_new = imx_pd_remove,
372370
.driver = {
373371
.of_match_table = imx_pd_dt_ids,
374372
.name = "imx-parallel-display",

0 commit comments

Comments
 (0)