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.
This commit is contained in:
Jordan Crouse 2010-11-01 03:00:59 -04:00 committed by Jon Benson
parent 30d2ca1d5e
commit 9e3544077c

View File

@ -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();