From 92c43deefca150854193c6720717d56b61989c23 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Tue, 20 Jun 2017 12:18:47 -0700 Subject: gpu: nvgpu: Remove Linux devnode fields from gk20a Move Linux devnode related fields to a new header file os_linux.h. The class structure is defined in module.c, so move its declaration to module.h. JIRA NVGPU-38 Change-Id: I5d8920169064f4289ff61004f7f81543a9aba221 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1505927 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/pci.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu/common/linux/pci.c') diff --git a/drivers/gpu/nvgpu/common/linux/pci.c b/drivers/gpu/nvgpu/common/linux/pci.c index 94ef340d..cb315973 100644 --- a/drivers/gpu/nvgpu/common/linux/pci.c +++ b/drivers/gpu/nvgpu/common/linux/pci.c @@ -32,6 +32,8 @@ #include "pci.h" +#include "os_linux.h" + #define PCI_INTERFACE_NAME "card-%s%%s" static int nvgpu_pci_tegra_probe(struct device *dev) @@ -346,6 +348,7 @@ static int nvgpu_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pent) { struct gk20a_platform *platform = NULL; + struct nvgpu_os_linux *l; struct gk20a *g; int err; char nodefmt[64]; @@ -359,12 +362,14 @@ static int nvgpu_pci_probe(struct pci_dev *pdev, platform = &nvgpu_pci_device[pent->driver_data]; pci_set_drvdata(pdev, platform); - g = kzalloc(sizeof(struct gk20a), GFP_KERNEL); - if (!g) { - nvgpu_err(g, "couldn't allocate gk20a support"); + l = kzalloc(sizeof(*l), GFP_KERNEL); + if (!l) { + dev_err(&pdev->dev, "couldn't allocate gk20a support"); return -ENOMEM; } + g = &l->g; + nvgpu_kmem_init(g); err = nvgpu_init_enabled_flags(g); -- cgit v1.2.2