lkml.org 
[lkml]   [2007]   [Jun]   [14]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateThu, 14 Jun 2007 08:24:17 +0200
FromJean Delvare <>
SubjectRe: [PATCH] i2c-gpio: Add support for new-style clients
Hi Atsushi,

On Wed, 13 Jun 2007 00:43:16 +0900 (JST), Atsushi Nemoto wrote:
> Use i2c_bit_add_numbered_bus() if device id specified, so that the
> i2c-gpio adapter works well with new-style pre-declared devices.
> 
> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
> ---
> diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c
> index a7dd546..8a62c26 100644
> --- a/drivers/i2c/busses/i2c-gpio.c
> +++ b/drivers/i2c/busses/i2c-gpio.c
> @@ -142,7 +142,10 @@ static int __init i2c_gpio_probe(struct platform_device *pdev)
>  	adap->algo_data = bit_data;
>  	adap->dev.parent = &pdev->dev;
> 
> -	ret = i2c_bit_add_bus(adap);
> +	if (pdev->id == -1)
> +		ret = i2c_bit_add_bus(adap);
> +	else
> +		ret = i2c_bit_add_numbered_bus(adap);
>  	if (ret)
>  		goto err_add_bus;
> 

This isn't sufficient. Before you call i2c_bit_add_numbered_bus(adap),
you are supposed to set adap->nr to the desired i2c adapter number.

-- 
Jean Delvare
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-06-14 08:32    [from the cache]
©2003-2008