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

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.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 558a25f9
......@@ -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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment