mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 04/12] i2c : Use mutex instead of semaphore in driver core
@ 2007-12-29  1:07 Dave Young
  2007-12-29 11:49 ` Stefan Richter
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Young @ 2007-12-29  1:07 UTC (permalink / raw)
  To: khali; +Cc: linux-kernel, i2c

Signed-off-by: Dave Young <hidave.darkstar@gmail.com> 

---
drivers/i2c/i2c-core.c |   10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff -upr linux/drivers/i2c/i2c-core.c linux.new/drivers/i2c/i2c-core.c
--- linux/drivers/i2c/i2c-core.c	2007-12-28 10:06:58.000000000 +0800
+++ linux.new/drivers/i2c/i2c-core.c	2007-12-28 10:08:58.000000000 +0800
@@ -33,8 +33,8 @@
 #include <linux/platform_device.h>
 #include <linux/mutex.h>
 #include <linux/completion.h>
+#include <linux/mutex.h>
 #include <asm/uaccess.h>
-#include <asm/semaphore.h>
 
 #include "i2c-core.h"
 
@@ -597,12 +597,12 @@ int i2c_register_driver(struct module *o
 	if (driver->attach_adapter) {
 		struct i2c_adapter *adapter;
 
-		down(&i2c_adapter_class.sem);
+		mutex_lock(&i2c_adapter_class.mutex);
 		list_for_each_entry(adapter, &i2c_adapter_class.devices,
 				    dev.node) {
 			driver->attach_adapter(adapter);
 		}
-		up(&i2c_adapter_class.sem);
+		mutex_unlock(&i2c_adapter_class.mutex);
 	}
 
 	mutex_unlock(&core_lock);
@@ -631,7 +631,7 @@ void i2c_del_driver(struct i2c_driver *d
 	 * attached. If so, detach them to be able to kill the driver
 	 * afterwards.
 	 */
-	down(&i2c_adapter_class.sem);
+	mutex_lock(&i2c_adapter_class.mutex);
 	list_for_each_entry(adap, &i2c_adapter_class.devices, dev.node) {
 		if (driver->detach_adapter) {
 			if (driver->detach_adapter(adap)) {
@@ -656,7 +656,7 @@ void i2c_del_driver(struct i2c_driver *d
 			}
 		}
 	}
-	up(&i2c_adapter_class.sem);
+	mutex_unlock(&i2c_adapter_class.mutex);
 
  unregister:
 	driver_unregister(&driver->driver);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 04/12] i2c : Use mutex instead of semaphore in driver core
  2007-12-29  1:07 [PATCH 04/12] i2c : Use mutex instead of semaphore in driver core Dave Young
@ 2007-12-29 11:49 ` Stefan Richter
  2008-01-02  1:06   ` Dave Young
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Richter @ 2007-12-29 11:49 UTC (permalink / raw)
  To: Dave Young; +Cc: khali, linux-kernel, i2c

Dave Young wrote:
> --- linux/drivers/i2c/i2c-core.c	2007-12-28 10:06:58.000000000 +0800
> +++ linux.new/drivers/i2c/i2c-core.c	2007-12-28 10:08:58.000000000 +0800
> @@ -33,8 +33,8 @@
>  #include <linux/platform_device.h>
>  #include <linux/mutex.h>
>  #include <linux/completion.h>
> +#include <linux/mutex.h>
>  #include <asm/uaccess.h>
> -#include <asm/semaphore.h>

2x #include <linux/mutex.h>
-- 
Stefan Richter
-=====-=-=== ==-- ===-=
http://arcgraph.de/sr/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 04/12] i2c : Use mutex instead of semaphore in driver core
  2007-12-29 11:49 ` Stefan Richter
@ 2008-01-02  1:06   ` Dave Young
  0 siblings, 0 replies; 3+ messages in thread
From: Dave Young @ 2008-01-02  1:06 UTC (permalink / raw)
  To: Stefan Richter; +Cc: khali, linux-kernel, i2c

On Dec 29, 2007 7:49 PM, Stefan Richter <stefanr@s5r6.in-berlin.de> wrote:
> Dave Young wrote:
> > --- linux/drivers/i2c/i2c-core.c      2007-12-28 10:06:58.000000000 +0800
> > +++ linux.new/drivers/i2c/i2c-core.c  2007-12-28 10:08:58.000000000 +0800
> > @@ -33,8 +33,8 @@
> >  #include <linux/platform_device.h>
> >  #include <linux/mutex.h>
> >  #include <linux/completion.h>
> > +#include <linux/mutex.h>
> >  #include <asm/uaccess.h>
> > -#include <asm/semaphore.h>
>
> 2x #include <linux/mutex.h>

Thanks, my fault ;)
This patch series need more lockdep works to be done. After that I
will repost it.

> --
> Stefan Richter
> -=====-=-=== ==-- ===-=
> http://arcgraph.de/sr/
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-01-02  1:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-29  1:07 [PATCH 04/12] i2c : Use mutex instead of semaphore in driver core Dave Young
2007-12-29 11:49 ` Stefan Richter
2008-01-02  1:06   ` Dave Young

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®