Commit 3c2ade01 authored by Sylwester Nawrocki's avatar Sylwester Nawrocki Committed by Mauro Carvalho Chehab

[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: default avatarLad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Acked-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Acked-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 408ed992
...@@ -27,7 +27,6 @@ static bool match_i2c(struct device *dev, struct v4l2_async_subdev *asd) ...@@ -27,7 +27,6 @@ static bool match_i2c(struct device *dev, struct v4l2_async_subdev *asd)
#if IS_ENABLED(CONFIG_I2C) #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->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 #else
...@@ -37,8 +36,7 @@ static bool match_i2c(struct device *dev, struct v4l2_async_subdev *asd) ...@@ -37,8 +36,7 @@ static bool match_i2c(struct device *dev, struct v4l2_async_subdev *asd)
static bool match_platform(struct device *dev, struct v4l2_async_subdev *asd) static bool match_platform(struct device *dev, struct v4l2_async_subdev *asd)
{ {
return asd->bus_type == V4L2_ASYNC_BUS_PLATFORM && return !strcmp(asd->match.platform.name, dev_name(dev));
!strcmp(asd->match.platform.name, dev_name(dev));
} }
static LIST_HEAD(subdev_list); static LIST_HEAD(subdev_list);
......
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