diff options
Diffstat (limited to 'drivers/i2c/algos')
-rw-r--r-- | drivers/i2c/algos/i2c-algo-bit.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c index 938170b8998b..38319a69bd0a 100644 --- a/drivers/i2c/algos/i2c-algo-bit.c +++ b/drivers/i2c/algos/i2c-algo-bit.c | |||
@@ -604,9 +604,10 @@ static int __i2c_bit_add_bus(struct i2c_adapter *adap, | |||
604 | int (*add_adapter)(struct i2c_adapter *)) | 604 | int (*add_adapter)(struct i2c_adapter *)) |
605 | { | 605 | { |
606 | struct i2c_algo_bit_data *bit_adap = adap->algo_data; | 606 | struct i2c_algo_bit_data *bit_adap = adap->algo_data; |
607 | int ret; | ||
607 | 608 | ||
608 | if (bit_test) { | 609 | if (bit_test) { |
609 | int ret = test_bus(bit_adap, adap->name); | 610 | ret = test_bus(bit_adap, adap->name); |
610 | if (ret < 0) | 611 | if (ret < 0) |
611 | return -ENODEV; | 612 | return -ENODEV; |
612 | } | 613 | } |
@@ -615,7 +616,16 @@ static int __i2c_bit_add_bus(struct i2c_adapter *adap, | |||
615 | adap->algo = &i2c_bit_algo; | 616 | adap->algo = &i2c_bit_algo; |
616 | adap->retries = 3; | 617 | adap->retries = 3; |
617 | 618 | ||
618 | return add_adapter(adap); | 619 | ret = add_adapter(adap); |
620 | if (ret < 0) | ||
621 | return ret; | ||
622 | |||
623 | /* Complain if SCL can't be read */ | ||
624 | if (bit_adap->getscl == NULL) { | ||
625 | dev_warn(&adap->dev, "Not I2C compliant: can't read SCL\n"); | ||
626 | dev_warn(&adap->dev, "Bus may be unreliable\n"); | ||
627 | } | ||
628 | return 0; | ||
619 | } | 629 | } |
620 | 630 | ||
621 | int i2c_bit_add_bus(struct i2c_adapter *adap) | 631 | int i2c_bit_add_bus(struct i2c_adapter *adap) |