[i2c] |PATCH] i2c: Don't uselessly set i2c_adapter.retries (v2)

Jean Delvare khali at linux-fr.org
Thu Nov 22 16:36:22 CET 2007


I2C adapter drivers are supposed to handle retries on nack by themselves
if they do, so there's no point in setting .retries if they don't.

As this retry mechanism is going away (at least in its current form),
clean this up now so that we don't get build failures later.

Signed-off-by: Jean Delvare <khali at linux-fr.org>
---
I split the mv64xxx changes to a separate patch for easier upstream
merging.

 drivers/i2c/algos/i2c-algo-pca.c |    3 +--
 drivers/i2c/busses/i2c-davinci.c |    1 -
 drivers/i2c/busses/i2c-ibm_iic.c |    1 -
 drivers/i2c/busses/i2c-iop3xx.c  |    1 -
 drivers/i2c/busses/i2c-mpc.c     |    1 -
 drivers/i2c/busses/i2c-omap.c    |    2 --
 6 files changed, 1 insertion(+), 8 deletions(-)

--- linux-2.6.24-rc3.orig/drivers/i2c/algos/i2c-algo-pca.c	2007-11-22 16:22:19.000000000 +0100
+++ linux-2.6.24-rc3/drivers/i2c/algos/i2c-algo-pca.c	2007-11-22 16:23:40.000000000 +0100
@@ -371,8 +371,7 @@ int i2c_pca_add_bus(struct i2c_adapter *
 	/* register new adapter to i2c module... */
 	adap->algo = &pca_algo;
 
-	adap->timeout = 100;		/* default values, should	*/
-	adap->retries = 3;		/* be replaced by defines	*/
+	adap->timeout = 100;		/* default value */
 
 	if ((rval = pca_init(pca_adap)))
 		return rval;
--- linux-2.6.24-rc3.orig/drivers/i2c/busses/i2c-davinci.c	2007-11-22 16:22:19.000000000 +0100
+++ linux-2.6.24-rc3/drivers/i2c/busses/i2c-davinci.c	2007-11-22 16:23:40.000000000 +0100
@@ -510,7 +510,6 @@ static int davinci_i2c_probe(struct plat
 
 	/* FIXME */
 	adap->timeout = 1;
-	adap->retries = 1;
 
 	adap->nr = pdev->id;
 	r = i2c_add_numbered_adapter(adap);
--- linux-2.6.24-rc3.orig/drivers/i2c/busses/i2c-ibm_iic.c	2007-11-22 16:22:19.000000000 +0100
+++ linux-2.6.24-rc3/drivers/i2c/busses/i2c-ibm_iic.c	2007-11-22 16:23:40.000000000 +0100
@@ -736,7 +736,6 @@ static int __devinit iic_probe(struct oc
 	adap->client_register = NULL;
 	adap->client_unregister = NULL;
 	adap->timeout = 1;
-	adap->retries = 1;
 
 	/*
 	 * If "dev->idx" is negative we consider it as zero.
--- linux-2.6.24-rc3.orig/drivers/i2c/busses/i2c-iop3xx.c	2007-11-22 16:22:19.000000000 +0100
+++ linux-2.6.24-rc3/drivers/i2c/busses/i2c-iop3xx.c	2007-11-22 16:23:40.000000000 +0100
@@ -490,7 +490,6 @@ iop3xx_i2c_probe(struct platform_device 
 	 * Default values...should these come in from board code?
 	 */
 	new_adapter->timeout = 100;	
-	new_adapter->retries = 3;
 	new_adapter->algo = &iop3xx_i2c_algo;
 
 	init_waitqueue_head(&adapter_data->waitq);
--- linux-2.6.24-rc3.orig/drivers/i2c/busses/i2c-mpc.c	2007-11-22 16:22:19.000000000 +0100
+++ linux-2.6.24-rc3/drivers/i2c/busses/i2c-mpc.c	2007-11-22 16:23:40.000000000 +0100
@@ -309,7 +309,6 @@ static struct i2c_adapter mpc_ops = {
 	.algo = &mpc_algo,
 	.class = I2C_CLASS_HWMON,
 	.timeout = 1,
-	.retries = 1
 };
 
 static int fsl_i2c_probe(struct platform_device *pdev)
--- linux-2.6.24-rc3.orig/drivers/i2c/busses/i2c-omap.c	2007-11-22 16:22:19.000000000 +0100
+++ linux-2.6.24-rc3/drivers/i2c/busses/i2c-omap.c	2007-11-22 16:23:40.000000000 +0100
@@ -362,8 +362,6 @@ omap_i2c_xfer(struct i2c_adapter *adap, 
 
 	omap_i2c_enable_clocks(dev);
 
-	/* REVISIT: initialize and use adap->retries. This is an optional
-	 * feature */
 	if ((r = omap_i2c_wait_for_bb(dev)) < 0)
 		goto out;
 

-- 
Jean Delvare



More information about the i2c mailing list