aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/v4l2-core
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2013-07-19 11:08:08 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2013-07-30 14:51:13 -0400
commit3c2ade017a7e10470aa8112f8a4bfdb2ee30f97f (patch)
tree319ed144de01980648689c4c7a96bce17dafe02e /drivers/media/v4l2-core
parent408ed9924c0d56d07e0888f6ae560a534ce5c18f (diff)
[media] V4L: Drop bus_type check in v4l2-async match functions
These match_* functions are internal callbacks and are always invoked only after checking asd->bus_type. So drop redundant checks in match_i2c() and match_platform() functions. Acked-and-tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/v4l2-core')
-rw-r--r--drivers/media/v4l2-core/v4l2-async.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c
index aae241730caa..ff87c299f640 100644
--- a/drivers/media/v4l2-core/v4l2-async.c
+++ b/drivers/media/v4l2-core/v4l2-async.c
@@ -27,7 +27,6 @@ static bool match_i2c(struct device *dev, struct v4l2_async_subdev *asd)
27#if IS_ENABLED(CONFIG_I2C) 27#if IS_ENABLED(CONFIG_I2C)
28 struct i2c_client *client = i2c_verify_client(dev); 28 struct i2c_client *client = i2c_verify_client(dev);
29 return client && 29 return client &&
30 asd->bus_type == V4L2_ASYNC_BUS_I2C &&
31 asd->match.i2c.adapter_id == client->adapter->nr && 30 asd->match.i2c.adapter_id == client->adapter->nr &&
32 asd->match.i2c.address == client->addr; 31 asd->match.i2c.address == client->addr;
33#else 32#else
@@ -37,8 +36,7 @@ static bool match_i2c(struct device *dev, struct v4l2_async_subdev *asd)
37 36
38static bool match_platform(struct device *dev, struct v4l2_async_subdev *asd) 37static bool match_platform(struct device *dev, struct v4l2_async_subdev *asd)
39{ 38{
40 return asd->bus_type == V4L2_ASYNC_BUS_PLATFORM && 39 return !strcmp(asd->match.platform.name, dev_name(dev));
41 !strcmp(asd->match.platform.name, dev_name(dev));
42} 40}
43 41
44static LIST_HEAD(subdev_list); 42static LIST_HEAD(subdev_list);