summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/pci.c
diff options
context:
space:
mode:
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);