diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 3499cc89..a6a51de5 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -84,6 +84,8 @@ u32 gk20a_dbg_ftrace; | |||
84 | 84 | ||
85 | #define GK20A_WAIT_FOR_IDLE_MS 2000 | 85 | #define GK20A_WAIT_FOR_IDLE_MS 2000 |
86 | 86 | ||
87 | static struct gk20a *gk20a_handle; | ||
88 | |||
87 | static int gk20a_pm_finalize_poweron(struct device *dev); | 89 | static int gk20a_pm_finalize_poweron(struct device *dev); |
88 | static int gk20a_pm_prepare_poweroff(struct device *dev); | 90 | static int gk20a_pm_prepare_poweroff(struct device *dev); |
89 | 91 | ||
@@ -1445,6 +1447,7 @@ static int gk20a_probe(struct platform_device *dev) | |||
1445 | 1447 | ||
1446 | set_gk20a(dev, gk20a); | 1448 | set_gk20a(dev, gk20a); |
1447 | gk20a->dev = dev; | 1449 | gk20a->dev = dev; |
1450 | gk20a_handle = gk20a; | ||
1448 | 1451 | ||
1449 | gk20a->irq_stall = platform_get_irq(dev, 0); | 1452 | gk20a->irq_stall = platform_get_irq(dev, 0); |
1450 | gk20a->irq_nonstall = platform_get_irq(dev, 1); | 1453 | gk20a->irq_nonstall = platform_get_irq(dev, 1); |
@@ -1600,6 +1603,7 @@ static int __exit gk20a_remove(struct platform_device *dev) | |||
1600 | 1603 | ||
1601 | gk20a_user_deinit(dev); | 1604 | gk20a_user_deinit(dev); |
1602 | 1605 | ||
1606 | gk20a_handle = NULL; | ||
1603 | set_gk20a(dev, 0); | 1607 | set_gk20a(dev, 0); |
1604 | #ifdef CONFIG_DEBUG_FS | 1608 | #ifdef CONFIG_DEBUG_FS |
1605 | debugfs_remove(g->debugfs_ltc_enabled); | 1609 | debugfs_remove(g->debugfs_ltc_enabled); |
@@ -1748,10 +1752,8 @@ void gk20a_reset(struct gk20a *g, u32 units) | |||
1748 | */ | 1752 | */ |
1749 | int gk20a_do_idle(void) | 1753 | int gk20a_do_idle(void) |
1750 | { | 1754 | { |
1751 | struct platform_device *pdev = to_platform_device( | 1755 | struct gk20a *g = gk20a_handle; |
1752 | bus_find_device_by_name(&platform_bus_type, | 1756 | struct platform_device *pdev = g->dev; |
1753 | NULL, "gk20a.0")); | ||
1754 | struct gk20a *g = get_gk20a(pdev); | ||
1755 | struct gk20a_platform *platform = dev_get_drvdata(&pdev->dev); | 1757 | struct gk20a_platform *platform = dev_get_drvdata(&pdev->dev); |
1756 | unsigned long timeout = jiffies + | 1758 | unsigned long timeout = jiffies + |
1757 | msecs_to_jiffies(GK20A_WAIT_FOR_IDLE_MS); | 1759 | msecs_to_jiffies(GK20A_WAIT_FOR_IDLE_MS); |
@@ -1831,10 +1833,8 @@ fail_timeout: | |||
1831 | */ | 1833 | */ |
1832 | int gk20a_do_unidle(void) | 1834 | int gk20a_do_unidle(void) |
1833 | { | 1835 | { |
1834 | struct platform_device *pdev = to_platform_device( | 1836 | struct gk20a *g = gk20a_handle; |
1835 | bus_find_device_by_name(&platform_bus_type, | 1837 | struct platform_device *pdev = g->dev; |
1836 | NULL, "gk20a.0")); | ||
1837 | struct gk20a *g = get_gk20a(pdev); | ||
1838 | struct gk20a_platform *platform = dev_get_drvdata(&pdev->dev); | 1838 | struct gk20a_platform *platform = dev_get_drvdata(&pdev->dev); |
1839 | 1839 | ||
1840 | if (g->forced_reset) { | 1840 | if (g->forced_reset) { |