Skip to content

Commit

Permalink
rtc-pcf8583: Check for i2c adapter functionality
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jean Delvare authored and Linus Torvalds committed Oct 16, 2007
1 parent a95e23a commit c018664
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/rtc/rtc-pcf8583.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,9 @@ static int pcf8583_probe(struct i2c_adapter *adap, int addr, int kind)
}
};

if (!i2c_check_functionality(adap, I2C_FUNC_I2C))
return 0;

pcf = kzalloc(sizeof(*pcf), GFP_KERNEL);
if (!pcf)
return -ENOMEM;
Expand Down

0 comments on commit c018664

Please sign in to comment.