Commit f1331ea8 authored by Thierry Reding's avatar Thierry Reding Committed by Ben Skeggs
Browse files

drm/nouveau: Do not try to disable PCI device on Tegra



When Nouveau is instantiated on top of a platform device, the dev->pdev
field will be NULL and calling pci_disable_device() will crash. Move the
PCI disabling code to the PCI specific driver removal code.

Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 0ac7facb
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -715,7 +715,6 @@ fail_nvkm:
void
nouveau_drm_device_remove(struct drm_device *dev)
{
	struct pci_dev *pdev = dev->pdev;
	struct nouveau_drm *drm = nouveau_drm(dev);
	struct nvkm_client *client;
	struct nvkm_device *device;
@@ -727,7 +726,6 @@ nouveau_drm_device_remove(struct drm_device *dev)
	device = nvkm_device_find(client->device);

	nouveau_drm_device_fini(dev);
	pci_disable_device(pdev);
	drm_dev_put(dev);
	nvkm_device_del(&device);
}
@@ -738,6 +736,7 @@ nouveau_drm_remove(struct pci_dev *pdev)
	struct drm_device *dev = pci_get_drvdata(pdev);

	nouveau_drm_device_remove(dev);
	pci_disable_device(pdev);
}

static int