Skip to contentSkip to conversation

drm/nouveau: Remove invalid reference to struct drm_device.pdev

PATCH In review Thomas Zimmermann 2 participants 2 messages May 12, 2021

Subsystems (3)
lore
Share & tools
lore

Thomas Zimmermann

author maintainer
#0 lore raw

PATCH 1/1 drm/nouveau: Remove invalid reference to struct drm_device.pdev

The pdev field got removed from struct drm_device recently. Replace the invalid reference with an upcast from the struct's dev field.

Fixes b347e04452ff ("drm: Remove pdev field from struct drm_device")
Cc Thomas Zimmermann <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>

---
This patch should be merged through drm-misc-next.

---
 drivers/gpu/drm/nouveau/nouveau_connector.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nouveau_connector.c +2 -1
index 7f38788a6c2b..2a298c171d4d 100644
@@ -460,7 +460,8 @@ nouveau_connector_of_detect(struct drm_connector *connector)
 	struct drm_device *dev = connector->dev;
 	struct nouveau_connector *nv_connector = nouveau_connector(connector);
 	struct nouveau_encoder *nv_encoder;
-	struct device_node *cn, *dn = pci_device_to_OF_node(dev->pdev);
+	struct pci_dev *pdev = to_pci_dev(dev->dev);
+	struct device_node *cn, *dn = pci_device_to_OF_node(pdev);
 
 	if (!dn ||
 	    !((nv_encoder = find_encoder(connector, DCB_OUTPUT_TMDS)) ||

--
2.31.1

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau

maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Thomas Zimmermann

The pdev field got removed from struct drm_device recently. Replace the invalid reference with an upcast from the struct's dev field.

Quoted 10 lines
Fixes b347e04452ff ("drm: Remove pdev field from struct drm_device")
Cc Thomas Zimmermann <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Quoted 2 lines

---
This patch should be merged through drm-misc-next.

please land asap.

Thanks,
Dave.

Quoted 21 lines
---
 drivers/gpu/drm/nouveau/nouveau_connector.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nouveau_connector.c +2 -2
index 7f38788a6c2b..2a298c171d4d 100644
@@ -460,7 +460,8 @@ nouveau_connector_of_detect(struct drm_connector *connector)
        struct drm_device *dev = connector->dev;
        struct nouveau_connector *nv_connector = nouveau_connector(connector);
        struct nouveau_encoder *nv_encoder;
-       struct device_node *cn, *dn = pci_device_to_OF_node(dev->pdev);
+       struct pci_dev *pdev = to_pci_dev(dev->dev);
+       struct device_node *cn, *dn = pci_device_to_OF_node(pdev);
 
        if (!dn ||
            !((nv_encoder = find_encoder(connector, DCB_OUTPUT_TMDS)) ||
--

2.31.1