diff options
author | Andrzej Hajda <a.hajda@samsung.com> | 2014-11-17 03:54:23 -0500 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2014-11-24 04:02:56 -0500 |
commit | 2f26bd7227b80d002dfcd3f60e71bfad168e6517 (patch) | |
tree | a121b5ea484ea7fa30dbfaf1326dc6a17f7f34f4 /drivers/gpu/drm/exynos | |
parent | 7340426affacb4b5988f9cf1c3dbfc28e9679360 (diff) |
drm/exynos/vidi: stop using display->ctx pointer
The patch replaces accesses to display->ctx pointer by container_of
construct. It will allow to remove ctx field in the future.
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_vidi.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c index f58dd52f6d60..3b6fdd614584 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c | |||
@@ -72,6 +72,11 @@ static inline struct vidi_context *manager_to_vidi(struct exynos_drm_manager *m) | |||
72 | return container_of(m, struct vidi_context, manager); | 72 | return container_of(m, struct vidi_context, manager); |
73 | } | 73 | } |
74 | 74 | ||
75 | static inline struct vidi_context *display_to_vidi(struct exynos_drm_display *d) | ||
76 | { | ||
77 | return container_of(d, struct vidi_context, display); | ||
78 | } | ||
79 | |||
75 | static const char fake_edid_info[] = { | 80 | static const char fake_edid_info[] = { |
76 | 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x4c, 0x2d, 0x05, 0x05, | 81 | 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x4c, 0x2d, 0x05, 0x05, |
77 | 0x00, 0x00, 0x00, 0x00, 0x30, 0x12, 0x01, 0x03, 0x80, 0x10, 0x09, 0x78, | 82 | 0x00, 0x00, 0x00, 0x00, 0x30, 0x12, 0x01, 0x03, 0x80, 0x10, 0x09, 0x78, |
@@ -419,7 +424,7 @@ int vidi_connection_ioctl(struct drm_device *drm_dev, void *data, | |||
419 | display = exynos_drm_get_display(encoder); | 424 | display = exynos_drm_get_display(encoder); |
420 | 425 | ||
421 | if (display->type == EXYNOS_DISPLAY_TYPE_VIDI) { | 426 | if (display->type == EXYNOS_DISPLAY_TYPE_VIDI) { |
422 | ctx = display->ctx; | 427 | ctx = display_to_vidi(display); |
423 | break; | 428 | break; |
424 | } | 429 | } |
425 | } | 430 | } |
@@ -529,7 +534,7 @@ static struct drm_connector_helper_funcs vidi_connector_helper_funcs = { | |||
529 | static int vidi_create_connector(struct exynos_drm_display *display, | 534 | static int vidi_create_connector(struct exynos_drm_display *display, |
530 | struct drm_encoder *encoder) | 535 | struct drm_encoder *encoder) |
531 | { | 536 | { |
532 | struct vidi_context *ctx = display->ctx; | 537 | struct vidi_context *ctx = display_to_vidi(display); |
533 | struct drm_connector *connector = &ctx->connector; | 538 | struct drm_connector *connector = &ctx->connector; |
534 | int ret; | 539 | int ret; |
535 | 540 | ||
@@ -597,8 +602,6 @@ static int vidi_probe(struct platform_device *pdev) | |||
597 | 602 | ||
598 | INIT_WORK(&ctx->work, vidi_fake_vblank_handler); | 603 | INIT_WORK(&ctx->work, vidi_fake_vblank_handler); |
599 | 604 | ||
600 | ctx->display.ctx = ctx; | ||
601 | |||
602 | mutex_init(&ctx->lock); | 605 | mutex_init(&ctx->lock); |
603 | 606 | ||
604 | platform_set_drvdata(pdev, ctx); | 607 | platform_set_drvdata(pdev, ctx); |