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 <[email protected]>
Cc: Xinliang Liu <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: dri-devel <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Acked-by: Xinliang Liu <[email protected]>
Reviewed-by: Sam Ravnborg <[email protected]>
Signed-off-by: Xu YiPing <[email protected]>
[jstultz: Reworded commit message]
Signed-off-by: John Stultz <[email protected]>
Signed-off-by: Sam Ravnborg <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
This commit is contained in:
Xu YiPing 2019-08-20 23:06:22 +00:00 • committed by Sam Ravnborg
commit a8c8af59e4
2 changed files with 1 additions and 3 deletions

View file

@ -999,7 +999,6 @@ static int ade_drm_init(struct platform_device *pdev)
DRM_ERROR("failed to alloc ade_data\n");
return -ENOMEM;
}
platform_set_drvdata(pdev, ade);
ctx = ade_hw_ctx_alloc(pdev, &ade->crtc.base);
if (IS_ERR(ctx)) {

View file

@ -44,8 +44,6 @@ static int kirin_drm_kms_init(struct drm_device *dev)
{
int ret;
dev_set_drvdata(dev->dev, dev);
/* dev->mode_config initialization */
drm_mode_config_init(dev);
dev->mode_config.min_width = 0;
@ -140,6 +138,7 @@ static int kirin_drm_bind(struct device *dev)
drm_dev = drm_dev_alloc(driver_data->driver, dev);
if (IS_ERR(drm_dev))
return PTR_ERR(drm_dev);
dev_set_drvdata(dev, drm_dev);
ret = kirin_drm_kms_init(drm_dev);
if (ret)