diff mbox series

[13/21] drm/nouveau/nvkm: move pci probe() defer from drm

Message ID 20240613170046.88687-14-bskeggs@nvidia.com (mailing list archive)
State New, archived
Headers show
Series drm/nouveau: insert auxiliary device between nvkm and drm | expand

Commit Message

Ben Skeggs June 13, 2024, 5 p.m. UTC
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com>
---
 drivers/gpu/drm/nouveau/nouveau_drm.c     | 3 ---
 drivers/gpu/drm/nouveau/nvkm/device/pci.c | 5 +++++
 2 files changed, 5 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 632635c16b88..3f1f93fa7029 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -795,9 +795,6 @@  static int nouveau_drm_probe(struct pci_dev *pdev,
 	struct nouveau_drm *drm;
 	int ret;
 
-	if (vga_switcheroo_client_probe_defer(pdev))
-		return -EPROBE_DEFER;
-
 	/* We need to check that the chipset is supported before booting
 	 * fbdev off the hardware, as there's no way to put it back.
 	 */
diff --git a/drivers/gpu/drm/nouveau/nvkm/device/pci.c b/drivers/gpu/drm/nouveau/nvkm/device/pci.c
index be6433eab814..21ca094df54f 100644
--- a/drivers/gpu/drm/nouveau/nvkm/device/pci.c
+++ b/drivers/gpu/drm/nouveau/nvkm/device/pci.c
@@ -26,6 +26,8 @@ 
 #include "acpi.h"
 #include "priv.h"
 
+#include <linux/vga_switcheroo.h>
+
 struct nvkm_device_pci_device {
 	u16 device;
 	const char *name;
@@ -1648,6 +1650,9 @@  nvkm_device_pci_probe(struct pci_dev *pci_dev, const struct pci_device_id *id)
 	struct nvkm_device *device;
 	int ret, bits;
 
+	if (vga_switcheroo_client_probe_defer(pci_dev))
+		return -EPROBE_DEFER;
+
 	switch (pci_dev->vendor) {
 	case 0x10de: pcid = nvkm_device_pci_10de; break;
 	default: