Commit f13c81a3 authored by Nuno Sá's avatar Nuno Sá Committed by Jonathan Cameron
Browse files

iio: dac: ad5593r: add check for i2c functionality



Make sure that the needed i2c functionality is supported during probe.

Signed-off-by: default avatarNuno Sá <nuno.sa@analog.com>
Signed-off-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Link: https://lore.kernel.org/r/20220913073413.140475-3-nuno.sa@analog.com


Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 558a25f9
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -102,6 +102,10 @@ static const struct ad5592r_rw_ops ad5593r_rw_ops = {
static int ad5593r_i2c_probe(struct i2c_client *i2c,
		const struct i2c_device_id *id)
{
	if (!i2c_check_functionality(i2c->adapter,
				     I2C_FUNC_SMBUS_BYTE | I2C_FUNC_I2C))
		return -EOPNOTSUPP;

	return ad5592r_probe(&i2c->dev, id->name, &ad5593r_rw_ops);
}