Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=066af983c74162fa98e7c5ffa8a5ead4a6979b1f
Commit:     066af983c74162fa98e7c5ffa8a5ead4a6979b1f
Parent:     4d6ceed4426cd85e1203a3153246334a3537f92b
Author:     Rodolfo Giometti <[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-pxa: Support new-style I2C drivers
    
    Signed-off-by: Rodolfo Giometti <[EMAIL PROTECTED]>
    Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
---
 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;
-
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

Reply via email to