Commit a8c8af59 authored by Xu YiPing's avatar Xu YiPing Committed by Sam Ravnborg

drm: kirin: Fix dev->driver_data setting

As part of refactoring the kirin driver to better support
different hardware revisions, this patch changes the
dev->driver_data to point to a drm_device, not ade_data.

Thus we set the driver data to drm device after alloc.

Cc: Rongrong Zou <zourongrong@gmail.com>
Cc: Xinliang Liu <z.liuxinliang@hisilicon.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel <dri-devel@lists.freedesktop.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Acked-by: default avatarXinliang Liu <z.liuxinliang@hisilicon.com>
Reviewed-by: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarXu YiPing <xuyiping@hisilicon.com>
[jstultz: Reworded commit message]
Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190820230626.23253-22-john.stultz@linaro.org
parent a51735be
...@@ -999,7 +999,6 @@ static int ade_drm_init(struct platform_device *pdev) ...@@ -999,7 +999,6 @@ static int ade_drm_init(struct platform_device *pdev)
DRM_ERROR("failed to alloc ade_data\n"); DRM_ERROR("failed to alloc ade_data\n");
return -ENOMEM; return -ENOMEM;
} }
platform_set_drvdata(pdev, ade);
ctx = ade_hw_ctx_alloc(pdev, &ade->crtc.base); ctx = ade_hw_ctx_alloc(pdev, &ade->crtc.base);
if (IS_ERR(ctx)) { if (IS_ERR(ctx)) {
......
...@@ -44,8 +44,6 @@ static int kirin_drm_kms_init(struct drm_device *dev) ...@@ -44,8 +44,6 @@ static int kirin_drm_kms_init(struct drm_device *dev)
{ {
int ret; int ret;
dev_set_drvdata(dev->dev, dev);
/* dev->mode_config initialization */ /* dev->mode_config initialization */
drm_mode_config_init(dev); drm_mode_config_init(dev);
dev->mode_config.min_width = 0; dev->mode_config.min_width = 0;
...@@ -140,6 +138,7 @@ static int kirin_drm_bind(struct device *dev) ...@@ -140,6 +138,7 @@ static int kirin_drm_bind(struct device *dev)
drm_dev = drm_dev_alloc(driver_data->driver, dev); drm_dev = drm_dev_alloc(driver_data->driver, dev);
if (IS_ERR(drm_dev)) if (IS_ERR(drm_dev))
return PTR_ERR(drm_dev); return PTR_ERR(drm_dev);
dev_set_drvdata(dev, drm_dev);
ret = kirin_drm_kms_init(drm_dev); ret = kirin_drm_kms_init(drm_dev);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment