diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/module.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/module.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c index af137c19..bfd2c790 100644 --- a/drivers/gpu/nvgpu/common/linux/module.c +++ b/drivers/gpu/nvgpu/common/linux/module.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #ifdef CONFIG_TEGRA_19x_GPU | 42 | #ifdef CONFIG_TEGRA_19x_GPU |
43 | #include "nvgpu_gpuid_t19x.h" | 43 | #include "nvgpu_gpuid_t19x.h" |
44 | #endif | 44 | #endif |
45 | #include "os_linux.h" | ||
45 | 46 | ||
46 | #define CLASS_NAME "nvidia-gpu" | 47 | #define CLASS_NAME "nvidia-gpu" |
47 | /* TODO: Change to e.g. "nvidia-gpu%s" once we have symlinks in place. */ | 48 | /* TODO: Change to e.g. "nvidia-gpu%s" once we have symlinks in place. */ |
@@ -849,6 +850,7 @@ static inline void set_gk20a(struct platform_device *pdev, struct gk20a *gk20a) | |||
849 | 850 | ||
850 | static int gk20a_probe(struct platform_device *dev) | 851 | static int gk20a_probe(struct platform_device *dev) |
851 | { | 852 | { |
853 | struct nvgpu_os_linux *l; | ||
852 | struct gk20a *gk20a; | 854 | struct gk20a *gk20a; |
853 | int err; | 855 | int err; |
854 | struct gk20a_platform *platform = NULL; | 856 | struct gk20a_platform *platform = NULL; |
@@ -874,12 +876,13 @@ static int gk20a_probe(struct platform_device *dev) | |||
874 | if (gk20a_gpu_is_virtual(&dev->dev)) | 876 | if (gk20a_gpu_is_virtual(&dev->dev)) |
875 | return vgpu_probe(dev); | 877 | return vgpu_probe(dev); |
876 | 878 | ||
877 | gk20a = kzalloc(sizeof(struct gk20a), GFP_KERNEL); | 879 | l = kzalloc(sizeof(*l), GFP_KERNEL); |
878 | if (!gk20a) { | 880 | if (!l) { |
879 | dev_err(&dev->dev, "couldn't allocate gk20a support"); | 881 | dev_err(&dev->dev, "couldn't allocate gk20a support"); |
880 | return -ENOMEM; | 882 | return -ENOMEM; |
881 | } | 883 | } |
882 | 884 | ||
885 | gk20a = &l->g; | ||
883 | set_gk20a(dev, gk20a); | 886 | set_gk20a(dev, gk20a); |
884 | gk20a->dev = &dev->dev; | 887 | gk20a->dev = &dev->dev; |
885 | gk20a->log_mask = NVGPU_DEFAULT_DBG_MASK; | 888 | gk20a->log_mask = NVGPU_DEFAULT_DBG_MASK; |