[i2c] [PATCH] PXA I2C: Update PXA platforms to support new-style I2C drivers.

Jean Delvare khali at linux-fr.org
Wed Jun 20 12:29:11 CEST 2007


Hi Rodolfo,

On Wed, 20 Jun 2007 11:25:47 +0200, Rodolfo Giometti wrote:
> Signed-off-by: Rodolfo Giometti <giometti at linux.it>
> ---
>  drivers/i2c/busses/i2c-pxa.c |    9 ++++++++-
>  1 files changed, 8 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
> index 28e7b91..9d6b790 100644
> --- a/drivers/i2c/busses/i2c-pxa.c
> +++ b/drivers/i2c/busses/i2c-pxa.c
> @@ -921,7 +921,14 @@ static int i2c_pxa_probe(struct platform_device *dev)
>  		i2c->adap.class = plat->class;
>  	}
>  
> -	ret = i2c_add_adapter(&i2c->adap);
> +	/*
> +	 * If "dev->id" 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.
> +	 */
> +	i2c->adap.nr = dev->id >= 0 ? dev->id : 0;
> +
> +	ret = i2c_add_numbered_adapter(&i2c->adap);
>  	if (ret < 0) {
>  		printk(KERN_INFO "I2C: Failed to add bus\n");
>  		goto eadapt;

I replaced the previous version with this one, thank you.

-- 
Jean Delvare



More information about the i2c mailing list