Skip to contentSkip to conversation

drm: Remove unused branch in legacy PCI initialization

PATCH In review Thomas Zimmermann 2 participants 2 messages May 16, 2021 – May 17, 2021

Subsystems (2)
lore
Share & tools
lore

Thomas Zimmermann

author maintainer
#0 lore raw

PATCH 1/1 drm: Remove unused branch in legacy PCI initialization

The legacy PCI init code sets the drvdata for drivers with MODESET flag, but none of the old UMS drivers sets the flag. Remove the branch.

---
 drivers/gpu/drm/drm_pci.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/drm_pci.c +0 -3
index 38c3cb72e7e6..f508f70e7a3f 100644
@@ -165,9 +165,6 @@ static int drm_legacy_get_pci_dev(struct pci_dev *pdev,
 	dev->hose = pdev->sysdata;
 #endif
 
-	if (drm_core_check_feature(dev, DRIVER_MODESET))
-		pci_set_drvdata(pdev, dev);
-
 	drm_legacy_pci_agp_init(dev);
 
 	ret = drm_dev_register(dev, ent->driver_data);
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Thomas Zimmermann

The legacy PCI init code sets the drvdata for drivers with MODESET flag, but none of the old UMS drivers sets the flag. Remove the branch.

Yeah now that this is legacy-only it really doesn't make sense anymore.

Quoted 21 lines
---
 drivers/gpu/drm/drm_pci.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/drm_pci.c +0 -3
index 38c3cb72e7e6..f508f70e7a3f 100644
@@ -165,9 +165,6 @@ static int drm_legacy_get_pci_dev(struct pci_dev *pdev,
 	dev->hose = pdev->sysdata;
 #endif
 
-	if (drm_core_check_feature(dev, DRIVER_MODESET))
-		pci_set_drvdata(pdev, dev);
-
 	drm_legacy_pci_agp_init(dev);
 
 	ret = drm_dev_register(dev, ent->driver_data);
Signature · 1 line
2.31.1
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch