diff options
author | Jean Delvare <jdelvare@suse.de> | 2011-10-30 08:47:25 -0400 |
---|---|---|
committer | Jean Delvare <khali@endymion.delvare> | 2011-10-30 08:47:25 -0400 |
commit | 1bddab7f7d5b61f17b0bbd669f60818d553620be (patch) | |
tree | fe2fe08e2027471e7c457bf0bf168e741d64ef7b /drivers/i2c/algos | |
parent | 6fcf84a2c0d5f51a457555d76e037cf3cc85bc7a (diff) |
i2c-algo-bit: Let user test buses without failing
Always failing to register I2C buses when the line testing fails is a
little harsh. While such a failure is definitely a bug in the driver
that exposes the affected I2C bus, things may still work fine if the
missing initialization steps are done later, before the I2C bus is
used. So it seems a better debugging tool to just report the test
failure by default. I introduce bit_test=2 if anyone really misses the
original behavior of bit_test=1.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Diffstat (limited to 'drivers/i2c/algos')
-rw-r--r-- | drivers/i2c/algos/i2c-algo-bit.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c index d6d58684712b..66bebfc81c22 100644 --- a/drivers/i2c/algos/i2c-algo-bit.c +++ b/drivers/i2c/algos/i2c-algo-bit.c | |||
@@ -47,8 +47,8 @@ | |||
47 | /* ----- global variables --------------------------------------------- */ | 47 | /* ----- global variables --------------------------------------------- */ |
48 | 48 | ||
49 | static int bit_test; /* see if the line-setting functions work */ | 49 | static int bit_test; /* see if the line-setting functions work */ |
50 | module_param(bit_test, bool, 0); | 50 | module_param(bit_test, int, S_IRUGO); |
51 | MODULE_PARM_DESC(bit_test, "Test the lines of the bus to see if it is stuck"); | 51 | MODULE_PARM_DESC(bit_test, "lines testing - 0 off; 1 report; 2 fail if stuck"); |
52 | 52 | ||
53 | #ifdef DEBUG | 53 | #ifdef DEBUG |
54 | static int i2c_debug = 1; | 54 | static int i2c_debug = 1; |
@@ -624,7 +624,7 @@ static int __i2c_bit_add_bus(struct i2c_adapter *adap, | |||
624 | 624 | ||
625 | if (bit_test) { | 625 | if (bit_test) { |
626 | ret = test_bus(adap); | 626 | ret = test_bus(adap); |
627 | if (ret < 0) | 627 | if (bit_test >= 2 && ret < 0) |
628 | return -ENODEV; | 628 | return -ENODEV; |
629 | } | 629 | } |
630 | 630 | ||