[i2c] [PATCH] i2c: Add support for new-style clients to ibm-iic driver (2nd try)

Jean Delvare khali at linux-fr.org
Wed Aug 29 14:30:52 CEST 2007


Hi Stefan,

On Wed, 29 Aug 2007 10:56:06 +0200, Stefan Roese wrote:
> Use i2c_bit_add_numbered_bus() if device id specified, so that the
> i2c-ibm_iic adapter works well with new-style pre-declared devices.
> 
> Signed-off-by: Stefan Roese <sr at denx.de>
> 
> ---
> Fixed a small error in the commit description above spotted by
> Eugene.
> 
> 
> commit 72daba7753178db457c1414dae1241e64b39f89d
> tree f595880e13321b165630ad2b9316346e23548357
> parent bcfc8d37d5abb8f60fcc05bccb1f4f118a238962
> author Stefan Roese <sr at denx.de> Wed, 29 Aug 2007 10:52:45 +0200
> committer Stefan Roese <sr at denx.de> Wed, 29 Aug 2007 10:52:45 +0200
> 
>  drivers/i2c/busses/i2c-ibm_iic.c |   10 +++++++++-
>  1 files changed, 9 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c
> index b6d2766..aa57c19 100644
> --- a/drivers/i2c/busses/i2c-ibm_iic.c
> +++ b/drivers/i2c/busses/i2c-ibm_iic.c
> @@ -742,7 +742,15 @@ static int __devinit iic_probe(struct ocp_device *ocp){
>  	if (adap->dev.parent == NULL) {
>  		adap->dev.parent = &platform_bus;
>  	}
> -	if ((ret = i2c_add_adapter(adap)) != 0){
> +
> +	/*
> +	 * If "dev->idx" is negative we consider it as zero.
> +	 * The reason to do so is to avoid sysfs names that only make
> +	 * sense when there are multiple adapters.
> +	 */
> +	adap->nr = dev->idx >= 0 ? dev->idx : 0;
> +
> +	if ((ret = i2c_add_numbered_adapter(adap)) < 0) {
>  		printk(KERN_CRIT "ibm-iic%d: failed to register i2c adapter\n",
>  			dev->idx);
>  		goto fail;

What tree is this patch based on? It doesn't apply on top of
2.6.23-rc4. Please provide a patch that applies on top of Linus' tree.

-- 
Jean Delvare



More information about the i2c mailing list