[ARM] S3C24XX: ADC: Check pending queue before freeing adc client

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Friday, April 17, 2009 - 3:00 pm

Gitweb:     http://git.kernel.org/linus/0c3ee078251b85812e585b5cf5d1635afd73f4e2
Commit:     0c3ee078251b85812e585b5cf5d1635afd73f4e2
Parent:     f8c8ac8109ecdd3583b0ac9fd3adf058678a802e
Author:     Ramax Lo <ramaxlo@gmail.com>
AuthorDate: Tue Apr 14 23:56:18 2009 +0800
Committer:  Ben Dooks <ben-linux@fluff.org>
CommitDate: Fri Apr 17 12:46:36 2009 +0100

    [ARM] S3C24XX: ADC: Check pending queue before freeing adc client
    
    Check pending queue and remove the adc client being released.
    
    Signed-off-by: Ramax Lo <ramaxlo@gmail.com>
    Signed-off-by: Ben Dooks <ben-linux@fluff.org>
---
 arch/arm/plat-s3c24xx/adc.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-s3c24xx/adc.c b/arch/arm/plat-s3c24xx/adc.c
index bc6f6a1..91adfa7 100644
--- a/arch/arm/plat-s3c24xx/adc.c
+++ b/arch/arm/plat-s3c24xx/adc.c
@@ -190,6 +190,23 @@ EXPORT_SYMBOL_GPL(s3c_adc_register);
 void s3c_adc_release(struct s3c_adc_client *client)
 {
 	/* We should really check that nothing is in progress. */
+	if (adc_dev->cur == client)
+		adc_dev->cur = NULL;
+	if (adc_dev->ts_pend == client)
+		adc_dev->ts_pend = NULL;
+	else {
+		struct list_head *p, *n;
+		struct s3c_adc_client *tmp;
+
+		list_for_each_safe(p, n, &adc_pending) {
+			tmp = list_entry(p, struct s3c_adc_client, pend);
+			if (tmp == client)
+				list_del(&tmp->pend);
+		}
+	}
+
+	if (adc_dev->cur == NULL)
+		s3c_adc_try(adc_dev);
 	kfree(client);
 }
 EXPORT_SYMBOL_GPL(s3c_adc_release);
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[ARM] S3C24XX: ADC: Check pending queue before freeing adc ..., Linux Kernel Mailing ..., (Fri Apr 17, 3:00 pm)