summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/pci.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-06-20 15:18:47 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-06-21 20:34:49 -0400
commit92c43deefca150854193c6720717d56b61989c23 (patch)
tree2dbfdcdb3a0809b80d4fc50e1d882326e54c7d17 /drivers/gpu/nvgpu/common/linux/pci.c
parent2ffbdc50d884215ba043e8afd3c3bcbefd1e66f8 (diff)
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 <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1505927 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/pci.c')
-rw-r--r--drivers/gpu/nvgpu/common/linux/pci.c11
1 files changed, 8 insertions, 3 deletions
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 @@
32 32
33#include "pci.h" 33#include "pci.h"
34 34
35#include "os_linux.h"
36
35#define PCI_INTERFACE_NAME "card-%s%%s" 37#define PCI_INTERFACE_NAME "card-%s%%s"
36 38
37static int nvgpu_pci_tegra_probe(struct device *dev) 39static int nvgpu_pci_tegra_probe(struct device *dev)
@@ -346,6 +348,7 @@ static int nvgpu_pci_probe(struct pci_dev *pdev,
346 const struct pci_device_id *pent) 348 const struct pci_device_id *pent)
347{ 349{
348 struct gk20a_platform *platform = NULL; 350 struct gk20a_platform *platform = NULL;
351 struct nvgpu_os_linux *l;
349 struct gk20a *g; 352 struct gk20a *g;
350 int err; 353 int err;
351 char nodefmt[64]; 354 char nodefmt[64];
@@ -359,12 +362,14 @@ static int nvgpu_pci_probe(struct pci_dev *pdev,
359 platform = &nvgpu_pci_device[pent->driver_data]; 362 platform = &nvgpu_pci_device[pent->driver_data];
360 pci_set_drvdata(pdev, platform); 363 pci_set_drvdata(pdev, platform);
361 364
362 g = kzalloc(sizeof(struct gk20a), GFP_KERNEL); 365 l = kzalloc(sizeof(*l), GFP_KERNEL);
363 if (!g) { 366 if (!l) {
364 nvgpu_err(g, "couldn't allocate gk20a support"); 367 dev_err(&pdev->dev, "couldn't allocate gk20a support");
365 return -ENOMEM; 368 return -ENOMEM;
366 } 369 }
367 370
371 g = &l->g;
372
368 nvgpu_kmem_init(g); 373 nvgpu_kmem_init(g);
369 374
370 err = nvgpu_init_enabled_flags(g); 375 err = nvgpu_init_enabled_flags(g);