All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] [PATCH] i2c-amd756: Improve mutex initialization
@ 2006-02-07 16:19 Jean Delvare
  0 siblings, 0 replies; only message in thread
From: Jean Delvare @ 2006-02-07 16:19 UTC (permalink / raw)
  To: lm-sensors

Hi all,

I am adding the following patch to my stack.

Static mutexes can be initialized at declaration time.

Signed-off-by: Jean Delvare <khali at linux-fr.org>
---
 drivers/i2c/busses/i2c-amd756-s4882.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- linux-2.6.16-rc2.orig/drivers/i2c/busses/i2c-amd756-s4882.c	2006-02-07 10:56:24.000000000 +0100
+++ linux-2.6.16-rc2/drivers/i2c/busses/i2c-amd756-s4882.c	2006-02-07 10:57:17.000000000 +0100
@@ -46,7 +46,7 @@
 static struct i2c_algorithm *s4882_algo;
 
 /* Wrapper access functions for multiplexed SMBus */
-static struct mutex amd756_lock;
+static DEFINE_MUTEX(amd756_lock);
 
 static s32 amd756_access_virt0(struct i2c_adapter * adap, u16 addr,
 			       unsigned short flags, char read_write,
@@ -167,8 +167,6 @@
 	}
 
 	printk(KERN_INFO "Enabling SMBus multiplexing for Tyan S4882\n");
-	mutex_init(&amd756_lock);
-
 	/* Define the 5 virtual adapters and algorithms structures */
 	if (!(s4882_adapter = kzalloc(5 * sizeof(struct i2c_adapter),
 				      GFP_KERNEL))) {


-- 
Jean Delvare


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-02-07 16:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-07 16:19 [lm-sensors] [PATCH] i2c-amd756: Improve mutex initialization Jean Delvare

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.