From: Ben Skeggs Date: Thu, 20 Aug 2015 04:54:06 +0000 (+1000) Subject: drm/nouveau/device: add direct pointer to struct device X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6d0d40e7a577bbc7497ee7fbfeb2315d46a872a6;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 --- diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/device.h b/drivers/gpu/drm/nouveau/include/nvkm/core/device.h index a3037f7d128d..d5811a0212be 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/device.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/device.h @@ -9,6 +9,7 @@ struct nvkm_device { struct pci_dev *pdev; struct platform_device *platformdev; + struct device *dev; u64 handle; struct nvkm_event event; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c index 2bceecc9c1e0..28ebe06e87b9 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c @@ -764,9 +764,11 @@ nvkm_device_create_(void *dev, enum nv_bus_type type, u64 name, switch (type) { case NVKM_BUS_PCI: device->pdev = dev; + device->dev = &device->pdev->dev; break; case NVKM_BUS_PLATFORM: device->platformdev = dev; + device->dev = &device->platformdev->dev; break; } device->handle = name;