summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/shmobile/shmob_drm_drv.c
diff options
context:
space:
mode:
authorThierry Reding2012-10-15 20:03:42 +0200
committerDave Airlie2012-10-23 02:15:11 +0200
commita16d4f86019a72b3e8cbb89abff769b25b53ab69 (patch)
treea028c3d9117b930e555159c0a0701efdb4e084e1 /drivers/gpu/drm/shmobile/shmob_drm_drv.c
parentdrm/debugfs: remove redundant info from gem_names (diff)
downloadkernel-qcow2-linux-a16d4f86019a72b3e8cbb89abff769b25b53ab69.tar.gz
kernel-qcow2-linux-a16d4f86019a72b3e8cbb89abff769b25b53ab69.tar.xz
kernel-qcow2-linux-a16d4f86019a72b3e8cbb89abff769b25b53ab69.zip
drm: platform: Don't initialize driver-private data
Platform device drivers usually use the driver-private data for their own purposes. Having it overwritten by drm_platform_init() is confusing and error-prone. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/shmobile/shmob_drm_drv.c')
-rw-r--r--drivers/gpu/drm/shmobile/shmob_drm_drv.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
index c71d493fd0c5..1c350fc4e449 100644
--- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c
+++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
@@ -201,6 +201,8 @@ static int shmob_drm_load(struct drm_device *dev, unsigned long flags)
goto done;
}
+ platform_set_drvdata(pdev, sdev);
+
done:
if (ret)
shmob_drm_unload(dev);
@@ -299,11 +301,9 @@ static struct drm_driver shmob_drm_driver = {
#if CONFIG_PM_SLEEP
static int shmob_drm_pm_suspend(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct drm_device *ddev = platform_get_drvdata(pdev);
- struct shmob_drm_device *sdev = ddev->dev_private;
+ struct shmob_drm_device *sdev = dev_get_drvdata(dev);
- drm_kms_helper_poll_disable(ddev);
+ drm_kms_helper_poll_disable(sdev->ddev);
shmob_drm_crtc_suspend(&sdev->crtc);
return 0;
@@ -311,9 +311,7 @@ static int shmob_drm_pm_suspend(struct device *dev)
static int shmob_drm_pm_resume(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct drm_device *ddev = platform_get_drvdata(pdev);
- struct shmob_drm_device *sdev = ddev->dev_private;
+ struct shmob_drm_device *sdev = dev_get_drvdata(dev);
mutex_lock(&sdev->ddev->mode_config.mutex);
shmob_drm_crtc_resume(&sdev->crtc);