diff options
author | Jean Delvare <khali@linux-fr.org> | 2007-10-16 04:28:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 12:43:13 -0400 |
commit | c018664c51aca418e16bc83f75257c68250fb052 (patch) | |
tree | 7c5578818c136391ff32cac934781c8423ee51e8 | |
parent | a95e23a27b33db5d5f40278b16a42e5e20188015 (diff) |
rtc-pcf8583: Check for i2c adapter functionality
Not all i2c adapters support I2C-level messaging. Check that the adapter
does before probing for a PCF8583 chip, as the driver makes use of
i2c_transfer and i2c_master_send.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/rtc/rtc-pcf8583.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-pcf8583.c b/drivers/rtc/rtc-pcf8583.c index d48b03374586..556d0e7da35b 100644 --- a/drivers/rtc/rtc-pcf8583.c +++ b/drivers/rtc/rtc-pcf8583.c | |||
@@ -332,6 +332,9 @@ static int pcf8583_probe(struct i2c_adapter *adap, int addr, int kind) | |||
332 | } | 332 | } |
333 | }; | 333 | }; |
334 | 334 | ||
335 | if (!i2c_check_functionality(adap, I2C_FUNC_I2C)) | ||
336 | return 0; | ||
337 | |||
335 | pcf = kzalloc(sizeof(*pcf), GFP_KERNEL); | 338 | pcf = kzalloc(sizeof(*pcf), GFP_KERNEL); |
336 | if (!pcf) | 339 | if (!pcf) |
337 | return -ENOMEM; | 340 | return -ENOMEM; |