summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/qxl/qxl_kms.c
diff options
context:
space:
mode:
authorGabriel Krisman Bertazi <krisman@collabora.co.uk>2017-01-27 04:05:48 +0300
committerGerd Hoffmann <kraxel@redhat.com>2017-02-02 12:02:37 +0300
commitcbdded7f8a633ee9418047c50a7114ce2282b912 (patch)
treea9192b0b9f595c0dbab7799865c536ba34286159 /drivers/gpu/drm/qxl/qxl_kms.c
parentd74d74aeaf0b29a158bc95c63c6b6b107a57f4f5 (diff)
downloadlinux-cbdded7f8a633ee9418047c50a7114ce2282b912.tar.xz
drm: qxl: Embed drm_device into driver structure
This is the recommended way to create the drm_device structure, according to DRM documentation. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk> Link: http://patchwork.freedesktop.org/patch/msgid/20170127010548.27970-4-krisman@collabora.co.uk Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/qxl/qxl_kms.c')
-rw-r--r--drivers/gpu/drm/qxl/qxl_kms.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/gpu/drm/qxl/qxl_kms.c b/drivers/gpu/drm/qxl/qxl_kms.c
index 52d1bc1bb0ca..2dcd5c14cb56 100644
--- a/drivers/gpu/drm/qxl/qxl_kms.c
+++ b/drivers/gpu/drm/qxl/qxl_kms.c
@@ -116,13 +116,20 @@ static void qxl_gc_work(struct work_struct *work)
}
int qxl_device_init(struct qxl_device *qdev,
- struct drm_device *ddev,
+ struct drm_driver *drv,
struct pci_dev *pdev,
unsigned long flags)
{
int r, sb;
- qdev->ddev = ddev;
+ r = drm_dev_init(&qdev->ddev, drv, &pdev->dev);
+ if (r)
+ return r;
+
+ qdev->ddev.pdev = pdev;
+ pci_set_drvdata(pdev, &qdev->ddev);
+ qdev->ddev.dev_private = qdev;
+
qdev->flags = flags;
mutex_init(&qdev->gem.mutex);