diff options
author | Chen Liangjun <b36089@freescale.com> | 2012-02-17 14:33:50 +0800 |
---|---|---|
committer | Chen Liangjun <b36089@freescale.com> | 2012-02-17 15:22:36 +0800 |
commit | 4f01f76f4e60713cba46b754f99e785c6d46e597 (patch) | |
tree | 316fe0703f19f2af23e4060a78a5e504cda7dd88 /drivers/mxc | |
parent | 5cfe06665c19092ddca273ee5f0642e8f1290896 (diff) |
ENGR00174747 ASRC:fix spinlock bug
When use clk_enable and clk_disable function, system may enter
sleep. so these 2 funciton can not used surrounding with spin
lock/unlock. And the clk_enable/disable function already keep
the counter of open and close and it is no need to keep the counter
in driver.
Signed-off-by: Chen Liangjun <b36089@freescale.com>
Diffstat (limited to 'drivers/mxc')
-rw-r--r-- | drivers/mxc/asrc/mxc_asrc.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/mxc/asrc/mxc_asrc.c b/drivers/mxc/asrc/mxc_asrc.c index 0a3860afc986..f088e401de37 100644 --- a/drivers/mxc/asrc/mxc_asrc.c +++ b/drivers/mxc/asrc/mxc_asrc.c @@ -51,7 +51,6 @@ static struct class *asrc_class; DEFINE_SPINLOCK(data_lock); DEFINE_SPINLOCK(input_int_lock); DEFINE_SPINLOCK(output_int_lock); -DEFINE_SPINLOCK(asrc_clock_lock); #define AICPA 0 /* Input Clock Divider A Offset */ #define AICDA 3 /* Input Clock Prescaler A Offset */ @@ -1523,13 +1522,8 @@ static int mxc_asrc_open(struct inode *inode, struct file *file) { int err = 0; struct asrc_pair_params *pair_params; - unsigned long lock_flags; - spin_lock_irqsave(&asrc_clock_lock, lock_flags); - g_asrc_data->counter++; clk_enable(mxc_asrc_data->asrc_core_clk); - spin_unlock_irqrestore(&asrc_clock_lock, lock_flags); - if (signal_pending(current)) return -EINTR; pair_params = kzalloc(sizeof(struct asrc_pair_params), GFP_KERNEL); @@ -1554,7 +1548,6 @@ static int mxc_asrc_open(struct inode *inode, struct file *file) static int mxc_asrc_close(struct inode *inode, struct file *file) { struct asrc_pair_params *pair_params; - unsigned long lock_flags; pair_params = file->private_data; if (pair_params->asrc_active == 1) { @@ -1573,12 +1566,8 @@ static int mxc_asrc_close(struct inode *inode, struct file *file) kfree(pair_params); file->private_data = NULL; + clk_disable(mxc_asrc_data->asrc_core_clk); - spin_lock_irqsave(&asrc_clock_lock, lock_flags); - g_asrc_data->counter--; - if (g_asrc_data->counter == 0) - clk_disable(mxc_asrc_data->asrc_core_clk); - spin_unlock_irqrestore(&asrc_clock_lock, lock_flags); return 0; } @@ -1728,7 +1717,6 @@ static int mxc_asrc_probe(struct platform_device *pdev) g_asrc_data->asrc_pair[0].overload_error = 0; g_asrc_data->asrc_pair[1].overload_error = 0; g_asrc_data->asrc_pair[2].overload_error = 0; - g_asrc_data->counter = 0; asrc_major = register_chrdev(asrc_major, "mxc_asrc", &asrc_fops); if (asrc_major < 0) { |