Skip to contentSkip to conversation

I2C: Fix some i2c algorithm initialization

PATCH New Jean Delvare 2 participants 2 messages May 19, 2005 I2C subsystem host drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 I2C: Fix some i2c algorithm initialization

Hi Greg,

While searching for i2c_algorithm declarations missing their .functionality member, I found three of them which were not properly initialized. i2c-algo-ite and i2c_sibyte_algo do not use the C99 initialization syntax, and i2c-ibm_iic.c explicitely initializes NULL members. Following patch puts some order in there.

Please apply, thanks.

drivers/i2c/algos/i2c-algo-ite.c renamed from drivers/i2c/algos/i2c-algo-ite.c.orig +5 -8
@@ -713,14 +713,11 @@
 /* -----exported algorithm data: -------------------------------------	*/
 
 static struct i2c_algorithm iic_algo = {
-	"ITE IIC algorithm",
-	I2C_ALGO_IIC,
-	iic_xfer,		/* master_xfer	*/
-	NULL,				/* smbus_xfer	*/
-	NULL,				/* slave_xmit		*/
-	NULL,				/* slave_recv		*/
-	algo_control,			/* ioctl		*/
-	iic_func,			/* functionality	*/
+	.name		= "ITE IIC algorithm",
+	.id		= I2C_ALGO_IIC,
+	.master_xfer	= iic_xfer,
+	.algo_control	= algo_control, /* ioctl */
+	.functionality	= iic_func,
 };
 
 
drivers/i2c/algos/i2c-algo-sibyte.c renamed from drivers/i2c/algos/i2c-algo-sibyte.c.orig +5 -8
@@ -136,14 +136,11 @@
 /* -----exported algorithm data: -------------------------------------	*/
 
 static struct i2c_algorithm i2c_sibyte_algo = {
-	"SiByte algorithm",
-	I2C_ALGO_SIBYTE,
-	NULL,                           /* master_xfer          */
-	smbus_xfer,                   	/* smbus_xfer           */
-	NULL,				/* slave_xmit		*/
-	NULL,				/* slave_recv		*/
-	algo_control,			/* ioctl		*/
-	bit_func,			/* functionality	*/
+	.name		= "SiByte algorithm",
+	.id		= I2C_ALGO_SIBYTE,
+	.smbus_xfer	= smbus_xfer,
+	.algo_control	= algo_control, /* ioctl */
+	.functionality	= bit_func,
 };
 
 /* 
drivers/i2c/busses/i2c-ibm_iic.c renamed from drivers/i2c/busses/i2c-ibm_iic.c.orig +0 -4
@@ -630,10 +630,6 @@
 	.name 		= "IBM IIC algorithm",
 	.id   		= I2C_ALGO_OCP,
 	.master_xfer 	= iic_xfer,
-	.smbus_xfer	= NULL,
-	.slave_send	= NULL,
-	.slave_recv	= NULL,
-	.algo_control	= NULL,
 	.functionality	= iic_func
 };
 
Signature · 1 line
Jean Delvare
Applied
#1 lore raw

PATCH 1/1 I2C: Fix some i2c algorithm initialization

Quoted 9 lines · Jean Delvare

Hi Greg,

While searching for i2c_algorithm declarations missing their .functionality member, I found three of them which were not properly initialized. i2c-algo-ite and i2c_sibyte_algo do not use the C99 initialization syntax, and i2c-ibm_iic.c explicitely initializes NULL members. Following patch puts some order in there.

Please apply, thanks.

Applied, thanks.

greg k-h