Skip to content

Commit 3c2eb78

Browse files
committed
Merge tag 'exynos-drm-next-for-v6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next
One bug fix - Add a missing call to drm_atomic_helper_shutdown() in Exynos DRM driver. This function is necessary during system shutdown and when the driver is unbound. Without this function, components like panels may not shut down properly, potentially leading to power issue as mentioned in the kernel documentation, specially in the "driver instance overview" secstion of 'drm_drv.c'. Two cleanups - Convert '.remove()' callback function in the Exynos DRM platform driver to a version that returns void instead of an integer. - Change connector type of exynos_drm_dpi.c module to DPI. Signed-off-by: Dave Airlie <[email protected]> From: Inki Dae <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents c1ee197 + ead5a41 commit 3c2eb78

15 files changed

+40
-56
lines changed

drivers/gpu/drm/exynos/exynos5433_drm_decon.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -862,18 +862,16 @@ static int exynos5433_decon_probe(struct platform_device *pdev)
862862
return ret;
863863
}
864864

865-
static int exynos5433_decon_remove(struct platform_device *pdev)
865+
static void exynos5433_decon_remove(struct platform_device *pdev)
866866
{
867867
pm_runtime_disable(&pdev->dev);
868868

869869
component_del(&pdev->dev, &decon_component_ops);
870-
871-
return 0;
872870
}
873871

874872
struct platform_driver exynos5433_decon_driver = {
875873
.probe = exynos5433_decon_probe,
876-
.remove = exynos5433_decon_remove,
874+
.remove_new = exynos5433_decon_remove,
877875
.driver = {
878876
.name = "exynos5433-decon",
879877
.pm = pm_ptr(&exynos5433_decon_pm_ops),

drivers/gpu/drm/exynos/exynos7_drm_decon.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ static int decon_probe(struct platform_device *pdev)
765765
return ret;
766766
}
767767

768-
static int decon_remove(struct platform_device *pdev)
768+
static void decon_remove(struct platform_device *pdev)
769769
{
770770
struct decon_context *ctx = dev_get_drvdata(&pdev->dev);
771771

@@ -774,8 +774,6 @@ static int decon_remove(struct platform_device *pdev)
774774
iounmap(ctx->regs);
775775

776776
component_del(&pdev->dev, &decon_component_ops);
777-
778-
return 0;
779777
}
780778

781779
static int exynos7_decon_suspend(struct device *dev)
@@ -840,7 +838,7 @@ static DEFINE_RUNTIME_DEV_PM_OPS(exynos7_decon_pm_ops, exynos7_decon_suspend,
840838

841839
struct platform_driver decon_driver = {
842840
.probe = decon_probe,
843-
.remove = decon_remove,
841+
.remove_new = decon_remove,
844842
.driver = {
845843
.name = "exynos-decon",
846844
.pm = pm_ptr(&exynos7_decon_pm_ops),

drivers/gpu/drm/exynos/exynos_dp.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,12 @@ static int exynos_dp_probe(struct platform_device *pdev)
250250
return component_add(&pdev->dev, &exynos_dp_ops);
251251
}
252252

253-
static int exynos_dp_remove(struct platform_device *pdev)
253+
static void exynos_dp_remove(struct platform_device *pdev)
254254
{
255255
struct exynos_dp_device *dp = platform_get_drvdata(pdev);
256256

257257
component_del(&pdev->dev, &exynos_dp_ops);
258258
analogix_dp_remove(dp->adp);
259-
260-
return 0;
261259
}
262260

263261
static int exynos_dp_suspend(struct device *dev)
@@ -285,7 +283,7 @@ MODULE_DEVICE_TABLE(of, exynos_dp_match);
285283

286284
struct platform_driver dp_driver = {
287285
.probe = exynos_dp_probe,
288-
.remove = exynos_dp_remove,
286+
.remove_new = exynos_dp_remove,
289287
.driver = {
290288
.name = "exynos-dp",
291289
.owner = THIS_MODULE,

drivers/gpu/drm/exynos/exynos_drm_dpi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ static int exynos_dpi_create_connector(struct drm_encoder *encoder)
101101

102102
ret = drm_connector_init(encoder->dev, connector,
103103
&exynos_dpi_connector_funcs,
104-
DRM_MODE_CONNECTOR_VGA);
104+
DRM_MODE_CONNECTOR_DPI);
105105
if (ret) {
106106
DRM_DEV_ERROR(ctx->dev,
107107
"failed to initialize connector with drm\n");

drivers/gpu/drm/exynos/exynos_drm_drv.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ static int exynos_drm_bind(struct device *dev)
300300
drm_mode_config_cleanup(drm);
301301
exynos_drm_cleanup_dma(drm);
302302
kfree(private);
303+
dev_set_drvdata(dev, NULL);
303304
err_free_drm:
304305
drm_dev_put(drm);
305306

@@ -313,6 +314,7 @@ static void exynos_drm_unbind(struct device *dev)
313314
drm_dev_unregister(drm);
314315

315316
drm_kms_helper_poll_fini(drm);
317+
drm_atomic_helper_shutdown(drm);
316318

317319
component_unbind_all(drm->dev, drm);
318320
drm_mode_config_cleanup(drm);
@@ -344,15 +346,23 @@ static int exynos_drm_platform_probe(struct platform_device *pdev)
344346
match);
345347
}
346348

347-
static int exynos_drm_platform_remove(struct platform_device *pdev)
349+
static void exynos_drm_platform_remove(struct platform_device *pdev)
348350
{
349351
component_master_del(&pdev->dev, &exynos_drm_ops);
350-
return 0;
352+
}
353+
354+
static void exynos_drm_platform_shutdown(struct platform_device *pdev)
355+
{
356+
struct drm_device *drm = platform_get_drvdata(pdev);
357+
358+
if (drm)
359+
drm_atomic_helper_shutdown(drm);
351360
}
352361

353362
static struct platform_driver exynos_drm_platform_driver = {
354363
.probe = exynos_drm_platform_probe,
355-
.remove = exynos_drm_platform_remove,
364+
.remove_new = exynos_drm_platform_remove,
365+
.shutdown = exynos_drm_platform_shutdown,
356366
.driver = {
357367
.name = "exynos-drm",
358368
.pm = &exynos_drm_pm_ops,

drivers/gpu/drm/exynos/exynos_drm_fimc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,7 +1367,7 @@ static int fimc_probe(struct platform_device *pdev)
13671367
return ret;
13681368
}
13691369

1370-
static int fimc_remove(struct platform_device *pdev)
1370+
static void fimc_remove(struct platform_device *pdev)
13711371
{
13721372
struct device *dev = &pdev->dev;
13731373
struct fimc_context *ctx = get_fimc_context(dev);
@@ -1377,8 +1377,6 @@ static int fimc_remove(struct platform_device *pdev)
13771377
pm_runtime_disable(dev);
13781378

13791379
fimc_put_clocks(ctx);
1380-
1381-
return 0;
13821380
}
13831381

13841382
static int fimc_runtime_suspend(struct device *dev)
@@ -1410,7 +1408,7 @@ MODULE_DEVICE_TABLE(of, fimc_of_match);
14101408

14111409
struct platform_driver fimc_driver = {
14121410
.probe = fimc_probe,
1413-
.remove = fimc_remove,
1411+
.remove_new = fimc_remove,
14141412
.driver = {
14151413
.of_match_table = fimc_of_match,
14161414
.name = "exynos-drm-fimc",

drivers/gpu/drm/exynos/exynos_drm_fimd.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,13 +1277,11 @@ static int fimd_probe(struct platform_device *pdev)
12771277
return ret;
12781278
}
12791279

1280-
static int fimd_remove(struct platform_device *pdev)
1280+
static void fimd_remove(struct platform_device *pdev)
12811281
{
12821282
pm_runtime_disable(&pdev->dev);
12831283

12841284
component_del(&pdev->dev, &fimd_component_ops);
1285-
1286-
return 0;
12871285
}
12881286

12891287
static int exynos_fimd_suspend(struct device *dev)
@@ -1325,7 +1323,7 @@ static DEFINE_RUNTIME_DEV_PM_OPS(exynos_fimd_pm_ops, exynos_fimd_suspend,
13251323

13261324
struct platform_driver fimd_driver = {
13271325
.probe = fimd_probe,
1328-
.remove = fimd_remove,
1326+
.remove_new = fimd_remove,
13291327
.driver = {
13301328
.name = "exynos4-fb",
13311329
.owner = THIS_MODULE,

drivers/gpu/drm/exynos/exynos_drm_g2d.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,7 +1530,7 @@ static int g2d_probe(struct platform_device *pdev)
15301530
return ret;
15311531
}
15321532

1533-
static int g2d_remove(struct platform_device *pdev)
1533+
static void g2d_remove(struct platform_device *pdev)
15341534
{
15351535
struct g2d_data *g2d = platform_get_drvdata(pdev);
15361536

@@ -1545,8 +1545,6 @@ static int g2d_remove(struct platform_device *pdev)
15451545
g2d_fini_cmdlist(g2d);
15461546
destroy_workqueue(g2d->g2d_workq);
15471547
kmem_cache_destroy(g2d->runqueue_slab);
1548-
1549-
return 0;
15501548
}
15511549

15521550
static int g2d_suspend(struct device *dev)
@@ -1609,7 +1607,7 @@ MODULE_DEVICE_TABLE(of, exynos_g2d_match);
16091607

16101608
struct platform_driver g2d_driver = {
16111609
.probe = g2d_probe,
1612-
.remove = g2d_remove,
1610+
.remove_new = g2d_remove,
16131611
.driver = {
16141612
.name = "exynos-drm-g2d",
16151613
.owner = THIS_MODULE,

drivers/gpu/drm/exynos/exynos_drm_gsc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,15 +1309,13 @@ static int gsc_probe(struct platform_device *pdev)
13091309
return ret;
13101310
}
13111311

1312-
static int gsc_remove(struct platform_device *pdev)
1312+
static void gsc_remove(struct platform_device *pdev)
13131313
{
13141314
struct device *dev = &pdev->dev;
13151315

13161316
component_del(dev, &gsc_component_ops);
13171317
pm_runtime_dont_use_autosuspend(dev);
13181318
pm_runtime_disable(dev);
1319-
1320-
return 0;
13211319
}
13221320

13231321
static int __maybe_unused gsc_runtime_suspend(struct device *dev)
@@ -1422,7 +1420,7 @@ MODULE_DEVICE_TABLE(of, exynos_drm_gsc_of_match);
14221420

14231421
struct platform_driver gsc_driver = {
14241422
.probe = gsc_probe,
1425-
.remove = gsc_remove,
1423+
.remove_new = gsc_remove,
14261424
.driver = {
14271425
.name = "exynos-drm-gsc",
14281426
.owner = THIS_MODULE,

drivers/gpu/drm/exynos/exynos_drm_mic.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -442,16 +442,14 @@ static int exynos_mic_probe(struct platform_device *pdev)
442442
return ret;
443443
}
444444

445-
static int exynos_mic_remove(struct platform_device *pdev)
445+
static void exynos_mic_remove(struct platform_device *pdev)
446446
{
447447
struct exynos_mic *mic = platform_get_drvdata(pdev);
448448

449449
component_del(&pdev->dev, &exynos_mic_component_ops);
450450
pm_runtime_disable(&pdev->dev);
451451

452452
drm_bridge_remove(&mic->bridge);
453-
454-
return 0;
455453
}
456454

457455
static const struct of_device_id exynos_mic_of_match[] = {
@@ -462,7 +460,7 @@ MODULE_DEVICE_TABLE(of, exynos_mic_of_match);
462460

463461
struct platform_driver mic_driver = {
464462
.probe = exynos_mic_probe,
465-
.remove = exynos_mic_remove,
463+
.remove_new = exynos_mic_remove,
466464
.driver = {
467465
.name = "exynos-mic",
468466
.pm = pm_ptr(&exynos_mic_pm_ops),

0 commit comments

Comments
 (0)