Commit fe05e141 authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Mauro Carvalho Chehab

[media] V4L2: fix compilation if CONFIG_I2C is undefined

i2c_verify_client() is only available, if I2C is enabled. Fix v4l2-async.c
compilation if I2C is disabled.
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent c4d6e631
...@@ -24,11 +24,15 @@ ...@@ -24,11 +24,15 @@
static bool match_i2c(struct device *dev, struct v4l2_async_subdev *asd) static bool match_i2c(struct device *dev, struct v4l2_async_subdev *asd)
{ {
#if IS_ENABLED(CONFIG_I2C)
struct i2c_client *client = i2c_verify_client(dev); struct i2c_client *client = i2c_verify_client(dev);
return client && return client &&
asd->bus_type == V4L2_ASYNC_BUS_I2C && asd->bus_type == V4L2_ASYNC_BUS_I2C &&
asd->match.i2c.adapter_id == client->adapter->nr && asd->match.i2c.adapter_id == client->adapter->nr &&
asd->match.i2c.address == client->addr; asd->match.i2c.address == client->addr;
#else
return false;
#endif
} }
static bool match_platform(struct device *dev, struct v4l2_async_subdev *asd) static bool match_platform(struct device *dev, struct v4l2_async_subdev *asd)
......
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