Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7589a326d1d8c9da575ca4cbc6a3e6af02b57ead
Commit:     7589a326d1d8c9da575ca4cbc6a3e6af02b57ead
Parent:     8056c6cb2bb1632aa9221dce0e43a61db37b420f
Author:     Stefan Roese <[EMAIL PROTECTED]>
AuthorDate: Sat Oct 13 23:56:30 2007 +0200
Committer:  Jean Delvare <[EMAIL PROTECTED]>
CommitDate: Sat Oct 13 23:56:30 2007 +0200

    i2c-ibm_iic: Add support for new-style clients
    
    Use i2c_bit_add_numbered_adapter() if device id specified, so that the
    i2c-ibm_iic adapter works well with new-style pre-declared devices.
    
    Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
    Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
---
 drivers/i2c/busses/i2c-ibm_iic.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c
index 8b14d14..e08baca 100644
--- a/drivers/i2c/busses/i2c-ibm_iic.c
+++ b/drivers/i2c/busses/i2c-ibm_iic.c
@@ -738,7 +738,14 @@ static int __devinit iic_probe(struct ocp_device *ocp){
        adap->timeout = 1;
        adap->retries = 1;
 
-       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;
-
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