summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu/vgpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/vgpu.c')
-rw-r--r--drivers/gpu/nvgpu/vgpu/vgpu.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.c b/drivers/gpu/nvgpu/vgpu/vgpu.c
index 1a6dbb35..d94543a8 100644
--- a/drivers/gpu/nvgpu/vgpu/vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/vgpu.c
@@ -259,6 +259,7 @@ static int vgpu_init_support(struct platform_device *pdev)
259{ 259{
260 struct resource *r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 260 struct resource *r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
261 struct gk20a *g = get_gk20a(&pdev->dev); 261 struct gk20a *g = get_gk20a(&pdev->dev);
262 void __iomem *regs;
262 int err = 0; 263 int err = 0;
263 264
264 if (!r) { 265 if (!r) {
@@ -267,13 +268,17 @@ static int vgpu_init_support(struct platform_device *pdev)
267 goto fail; 268 goto fail;
268 } 269 }
269 270
270 g->bar1 = devm_ioremap_resource(&pdev->dev, r); 271 regs = devm_ioremap_resource(&pdev->dev, r);
271 if (IS_ERR(g->bar1)) { 272 if (IS_ERR(regs)) {
272 dev_err(dev_from_gk20a(g), "failed to remap gk20a bar1\n"); 273 dev_err(dev_from_gk20a(g), "failed to remap gk20a regs\n");
273 err = PTR_ERR(g->bar1); 274 err = PTR_ERR(g->bar1);
274 goto fail; 275 goto fail;
275 } 276 }
276 g->bar1_mem = r; 277
278 if (r->name && !strcmp(r->name, "/vgpu")) {
279 g->bar1 = regs;
280 g->bar1_mem = r;
281 }
277 282
278 nvgpu_mutex_init(&g->dbg_sessions_lock); 283 nvgpu_mutex_init(&g->dbg_sessions_lock);
279 nvgpu_mutex_init(&g->client_lock); 284 nvgpu_mutex_init(&g->client_lock);