Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7e69c3ac93a9a7aa29dab7179f86da67db7b0ca3 Commit: 7e69c3ac93a9a7aa29dab7179f86da67db7b0ca3 Parent: 757ba4c697244da878b65585d8cb671da1cb9eaf Author: Atsushi Nemoto <[EMAIL PROTECTED]> AuthorDate: Thu Jul 12 14:12:30 2007 +0200 Committer: Jean Delvare <[EMAIL PROTECTED]> CommitDate: Thu Jul 12 14:12:30 2007 +0200
i2c-gpio: Add support for new-style clients Use i2c_bit_add_numbered_bus() so that the i2c-gpio adapter works well with new-style pre-declared devices. Signed-off-by: Atsushi Nemoto <[EMAIL PROTECTED]> Signed-off-by: Jean Delvare <[EMAIL PROTECTED]> --- drivers/i2c/busses/i2c-gpio.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c index a7dd546..d6dbd6a 100644 --- a/drivers/i2c/busses/i2c-gpio.c +++ b/drivers/i2c/busses/i2c-gpio.c @@ -142,7 +142,13 @@ 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 "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. + */ + adap->nr = pdev->id >= 0 ? pdev->id : 0; + ret = i2c_bit_add_numbered_bus(adap); if (ret) goto err_add_bus; - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html