From 241151fd8c287268103ca8765d224c11f28b8c2e Mon Sep 17 00:00:00 2001 From: jsg Date: Thu, 29 Aug 2024 03:38:13 +0000 Subject: [PATCH] call pci_set_drvdata() on attach --- sys/dev/pci/drm/i915/i915_driver.c | 2 ++ sys/dev/pci/drm/radeon/radeon_drv.c | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/sys/dev/pci/drm/i915/i915_driver.c b/sys/dev/pci/drm/i915/i915_driver.c index 6254ebaac5c..00ab1ef519b 100644 --- a/sys/dev/pci/drm/i915/i915_driver.c +++ b/sys/dev/pci/drm/i915/i915_driver.c @@ -2307,6 +2307,8 @@ inteldrm_attach(struct device *parent, struct device *self, void *aux) return; } + pci_set_drvdata(dev->pdev, dev_priv); + /* Device parameters start as a copy of module parameters. */ i915_params_copy(&dev_priv->params, &i915_modparams); dev_priv->params.request_timeout_ms = 0; diff --git a/sys/dev/pci/drm/radeon/radeon_drv.c b/sys/dev/pci/drm/radeon/radeon_drv.c index 0bf66e89d94..41837acf7ba 100644 --- a/sys/dev/pci/drm/radeon/radeon_drv.c +++ b/sys/dev/pci/drm/radeon/radeon_drv.c @@ -1273,10 +1273,11 @@ radeondrm_attachhook(struct device *self) task_set(&rdev->switchtask, radeondrm_doswitch, ri); - /* - * in linux via radeon_pci_probe -> drm_get_pci_dev -> drm_dev_register - */ - drm_dev_register(rdev->ddev, rdev->flags); + /* from linux radeon_pci_probe() */ + + pci_set_drvdata(dev->pdev, dev); + + drm_dev_register(dev, rdev->flags); radeon_fbdev_setup(rdev); -- 2.20.1