Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c018664c authored by Jean Delvare's avatar Jean Delvare Committed by Linus Torvalds
Browse files

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: default avatarJean Delvare <khali@linux-fr.org>
Signed-off-by: default avatarAlessandro Zummo <a.zummo@towertech.it>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a95e23a2
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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;