From 9e3544077c1b84fd6c03ebb0a261abb92f0b308d Mon Sep 17 00:00:00 2001 From: Jordan Crouse Date: Mon, 1 Nov 2010 03:00:59 -0400 Subject: [PATCH] msm_kgsl: Move kgsl_sharedmem_init to module load kgsl_sharedmem_init/kgsl_sharedmem_close only need to be called once, so move them to the the module load and close functions so they can be available through the life of the module. --- drivers/video/msm/gpu/kgsl/kgsl.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/video/msm/gpu/kgsl/kgsl.c b/drivers/video/msm/gpu/kgsl/kgsl.c index 7d36973e..2e1bdc0f 100644 --- a/drivers/video/msm/gpu/kgsl/kgsl.c +++ b/drivers/video/msm/gpu/kgsl/kgsl.c @@ -192,11 +192,6 @@ static int kgsl_first_open_locked(void) kgsl_clk_enable(); - /* init memory apertures */ - result = kgsl_sharedmem_init(&kgsl_driver.shmem); - if (result != 0) - goto done; - /* init devices */ result = kgsl_yamato_init(&kgsl_driver.yamato_device, &kgsl_driver.yamato_config); @@ -223,9 +218,6 @@ static int kgsl_last_release_locked(void) /* close devices */ kgsl_yamato_close(&kgsl_driver.yamato_device); - /* shutdown memory apertures */ - kgsl_sharedmem_close(&kgsl_driver.shmem); - kgsl_clk_disable(); kgsl_driver.active = false; wake_unlock(&kgsl_driver.wake_lock); @@ -1110,6 +1102,9 @@ static void kgsl_driver_cleanup(void) kgsl_driver.interrupt_num = 0; } + /* shutdown memory apertures */ + kgsl_sharedmem_close(&kgsl_driver.shmem); + if (kgsl_driver.grp_clk) { clk_put(kgsl_driver.grp_clk); kgsl_driver.grp_clk = NULL; @@ -1219,6 +1214,9 @@ static int __devinit kgsl_platform_probe(struct platform_device *pdev) kgsl_driver.shmem.physbase = res->start; kgsl_driver.shmem.size = resource_size(res); + /* init memory apertures */ + result = kgsl_sharedmem_init(&kgsl_driver.shmem); + done: if (result) kgsl_driver_cleanup();