LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] Alchemy Semi Au1000 pcmcia driver: convert pcmcia_sockets_lock in a mutex
@ 2008-03-06 22:22 Matthias Kaehlcke
  2008-03-07  3:05 ` Daniel Walker
  0 siblings, 1 reply; 4+ messages in thread
From: Matthias Kaehlcke @ 2008-03-06 22:22 UTC (permalink / raw)
  To: linux-pcmcia; +Cc: linux-kernel, akpm

Alchemy Semi Au1000 pcmcia driver: The semaphore pcmcia_sockets_lock
is used as a mutex, convert it to the mutex API

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>

--

 #include <linux/interrupt.h>
 #include <linux/spinlock.h>
+#include <linux/mutex.h>
 #include <linux/platform_device.h>
 
 #include <asm/io.h>
@@ -71,7 +72,7 @@ extern struct au1000_pcmcia_socket au1000_pcmcia_socket[];
 u32 *pcmcia_base_vaddrs[2];
 extern const unsigned long mips_io_port_base;
 
-DECLARE_MUTEX(pcmcia_sockets_lock);
+DEFINE_MUTEX(pcmcia_sockets_lock);
 
 static int (*au1x00_pcmcia_hw_init[])(struct device *dev) = {
 	au1x_board_init,
@@ -472,7 +473,7 @@ int au1x00_drv_pcmcia_remove(struct device *dev)
 	struct skt_dev_info *sinfo = dev_get_drvdata(dev);
 	int i;
 
-	down(&pcmcia_sockets_lock);
+	mutex_lock(&pcmcia_sockets_lock);
 	dev_set_drvdata(dev, NULL);
 
 	for (i = 0; i < sinfo->nskt; i++) {
@@ -488,7 +489,7 @@ int au1x00_drv_pcmcia_remove(struct device *dev)
 	}
 
 	kfree(sinfo);
-	up(&pcmcia_sockets_lock);
+	mutex_unlock(&pcmcia_sockets_lock);
 	return 0;
 }
 
@@ -501,13 +502,13 @@ static int au1x00_drv_pcmcia_probe(struct device *dev)
 {
 	int i, ret = -ENODEV;
 
-	down(&pcmcia_sockets_lock);
+	mutex_lock(&pcmcia_sockets_lock);
 	for (i=0; i < ARRAY_SIZE(au1x00_pcmcia_hw_init); i++) {
 		ret = au1x00_pcmcia_hw_init[i](dev);
 		if (ret == 0)
 			break;
 	}
-	up(&pcmcia_sockets_lock);
+	mutex_unlock(&pcmcia_sockets_lock);
 	return ret;
 }

-- 
Matthias Kaehlcke
Linux System Developer
Barcelona

                Don't walk behind me, I may not lead
             Don't walk in front of me, I may not follow
                Just walk beside me and be my friend
                          (Albert Camus)
                                                                 .''`.
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-

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

* Re: [PATCH] Alchemy Semi Au1000 pcmcia driver: convert pcmcia_sockets_lock in a mutex
  2008-03-06 22:22 [PATCH] Alchemy Semi Au1000 pcmcia driver: convert pcmcia_sockets_lock in a mutex Matthias Kaehlcke
@ 2008-03-07  3:05 ` Daniel Walker
  2008-03-07  7:13   ` Matthias Kaehlcke
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Walker @ 2008-03-07  3:05 UTC (permalink / raw)
  To: Matthias Kaehlcke; +Cc: linux-pcmcia, linux-kernel, akpm


On Thu, 2008-03-06 at 23:22 +0100, Matthias Kaehlcke wrote:
> Alchemy Semi Au1000 pcmcia driver: The semaphore pcmcia_sockets_lock
> is used as a mutex, convert it to the mutex API
> 
> Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
> 
> --
> 
>  #include <linux/interrupt.h>

This doesn't appear to be in patch format .. There no filename at the
top..

Daniel


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

* Re: [PATCH] Alchemy Semi Au1000 pcmcia driver: convert pcmcia_sockets_lock in a mutex
  2008-03-07  3:05 ` Daniel Walker
@ 2008-03-07  7:13   ` Matthias Kaehlcke
  2008-03-07  7:38     ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Matthias Kaehlcke @ 2008-03-07  7:13 UTC (permalink / raw)
  To: Daniel Walker; +Cc: linux-pcmcia, linux-kernel, akpm

El Thu, Mar 06, 2008 at 07:05:49PM -0800 Daniel Walker ha dit:

> On Thu, 2008-03-06 at 23:22 +0100, Matthias Kaehlcke wrote:
> > Alchemy Semi Au1000 pcmcia driver: The semaphore pcmcia_sockets_lock
> > is used as a mutex, convert it to the mutex API
> > 
> > Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
> > 
> 
> This doesn't appear to be in patch format .. There no filename at the
> top..

somehow i messed it up when adding the patch to the mail. thanks for
the pointer, here comes the good one

-- 

Alchemy Semi Au1000 pcmcia driver: The semaphore pcmcia_sockets_lock
is used as a mutex, convert it to the mutex API
 
Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>

-- 

diff --git a/drivers/pcmcia/au1000_generic.c b/drivers/pcmcia/au1000_generic.c
index b693367..97e29c8 100644
--- a/drivers/pcmcia/au1000_generic.c
+++ b/drivers/pcmcia/au1000_generic.c
@@ -41,6 +41,7 @@
 #include <linux/notifier.h>
 #include <linux/interrupt.h>
 #include <linux/spinlock.h>
+#include <linux/mutex.h>
 #include <linux/platform_device.h>
 
 #include <asm/io.h>
@@ -71,7 +72,7 @@ extern struct au1000_pcmcia_socket au1000_pcmcia_socket[];
 u32 *pcmcia_base_vaddrs[2];
 extern const unsigned long mips_io_port_base;
 
-DECLARE_MUTEX(pcmcia_sockets_lock);
+DEFINE_MUTEX(pcmcia_sockets_lock);
 
 static int (*au1x00_pcmcia_hw_init[])(struct device *dev) = {
 	au1x_board_init,
@@ -472,7 +473,7 @@ int au1x00_drv_pcmcia_remove(struct device *dev)
 	struct skt_dev_info *sinfo = dev_get_drvdata(dev);
 	int i;
 
-	down(&pcmcia_sockets_lock);
+	mutex_lock(&pcmcia_sockets_lock);
 	dev_set_drvdata(dev, NULL);
 
 	for (i = 0; i < sinfo->nskt; i++) {
@@ -488,7 +489,7 @@ int au1x00_drv_pcmcia_remove(struct device *dev)
 	}
 
 	kfree(sinfo);
-	up(&pcmcia_sockets_lock);
+	mutex_unlock(&pcmcia_sockets_lock);
 	return 0;
 }
 
@@ -501,13 +502,13 @@ static int au1x00_drv_pcmcia_probe(struct device *dev)
 {
 	int i, ret = -ENODEV;
 
-	down(&pcmcia_sockets_lock);
+	mutex_lock(&pcmcia_sockets_lock);
 	for (i=0; i < ARRAY_SIZE(au1x00_pcmcia_hw_init); i++) {
 		ret = au1x00_pcmcia_hw_init[i](dev);
 		if (ret == 0)
 			break;
 	}
-	up(&pcmcia_sockets_lock);
+	mutex_unlock(&pcmcia_sockets_lock);
 	return ret;
 }

-- 
Matthias Kaehlcke
Linux System Developer
Barcelona

      Anyone who has never made a mistake has never tried anything new
                            (Albert Einstein)
                                                                 .''`.
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-

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

* Re: [PATCH] Alchemy Semi Au1000 pcmcia driver: convert pcmcia_sockets_lock in a mutex
  2008-03-07  7:13   ` Matthias Kaehlcke
@ 2008-03-07  7:38     ` Andrew Morton
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2008-03-07  7:38 UTC (permalink / raw)
  To: Matthias Kaehlcke; +Cc: Daniel Walker, linux-pcmcia, linux-kernel, Ralf Baechle

On Fri, 7 Mar 2008 08:13:42 +0100 Matthias Kaehlcke <matthias@kaehlcke.net> wrote:

> El Thu, Mar 06, 2008 at 07:05:49PM -0800 Daniel Walker ha dit:
> 
> > On Thu, 2008-03-06 at 23:22 +0100, Matthias Kaehlcke wrote:
> > > Alchemy Semi Au1000 pcmcia driver: The semaphore pcmcia_sockets_lock
> > > is used as a mutex, convert it to the mutex API
> > > 
> > > Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
> > > 
> > 
> > This doesn't appear to be in patch format .. There no filename at the
> > top..
> 
> somehow i messed it up when adding the patch to the mail. thanks for
> the pointer, here comes the good one
> 
> -- 
> 
> Alchemy Semi Au1000 pcmcia driver: The semaphore pcmcia_sockets_lock
> is used as a mutex, convert it to the mutex API

OK.

> @@ -71,7 +72,7 @@ extern struct au1000_pcmcia_socket au1000_pcmcia_socket[];
>  u32 *pcmcia_base_vaddrs[2];
>  extern const unsigned long mips_io_port_base;
>  
> -DECLARE_MUTEX(pcmcia_sockets_lock);
> +DEFINE_MUTEX(pcmcia_sockets_lock);

I'll make this static while we're in there.



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

end of thread, other threads:[~2008-03-07  7:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-06 22:22 [PATCH] Alchemy Semi Au1000 pcmcia driver: convert pcmcia_sockets_lock in a mutex Matthias Kaehlcke
2008-03-07  3:05 ` Daniel Walker
2008-03-07  7:13   ` Matthias Kaehlcke
2008-03-07  7:38     ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).