drm/nouveau/device: add direct pointer to struct device
A future commit will hide the platform/pci specifics from nvkm_device, but it's still very useful in a lot of places to have access to the Linux device struct. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
parent
741d778ea0
commit
6d0d40e7a5
2 changed files with 3 additions and 0 deletions
|
@ -9,6 +9,7 @@ struct nvkm_device {
|
||||||
|
|
||||||
struct pci_dev *pdev;
|
struct pci_dev *pdev;
|
||||||
struct platform_device *platformdev;
|
struct platform_device *platformdev;
|
||||||
|
struct device *dev;
|
||||||
u64 handle;
|
u64 handle;
|
||||||
|
|
||||||
struct nvkm_event event;
|
struct nvkm_event event;
|
||||||
|
|
|
@ -764,9 +764,11 @@ nvkm_device_create_(void *dev, enum nv_bus_type type, u64 name,
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case NVKM_BUS_PCI:
|
case NVKM_BUS_PCI:
|
||||||
device->pdev = dev;
|
device->pdev = dev;
|
||||||
|
device->dev = &device->pdev->dev;
|
||||||
break;
|
break;
|
||||||
case NVKM_BUS_PLATFORM:
|
case NVKM_BUS_PLATFORM:
|
||||||
device->platformdev = dev;
|
device->platformdev = dev;
|
||||||
|
device->dev = &device->platformdev->dev;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
device->handle = name;
|
device->handle = name;
|
||||||
|
|
Loading…
Add table
Reference in a new issue