Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by

Guennadi Liakhovetski and committed by
Mauro Carvalho Chehab
fe05e141 c4d6e631

+4
+4
drivers/media/v4l2-core/v4l2-async.c
··· 24 24 25 25 static bool match_i2c(struct device *dev, struct v4l2_async_subdev *asd) 26 26 { 27 + #if IS_ENABLED(CONFIG_I2C) 27 28 struct i2c_client *client = i2c_verify_client(dev); 28 29 return client && 29 30 asd->bus_type == V4L2_ASYNC_BUS_I2C && 30 31 asd->match.i2c.adapter_id == client->adapter->nr && 31 32 asd->match.i2c.address == client->addr; 33 + #else 34 + return false; 35 + #endif 32 36 } 33 37 34 38 static bool match_platform(struct device *dev, struct v4l2_async_subdev *asd)