From: Sylwester Nawrocki Date: Fri, 19 Jul 2013 15:08:08 +0000 (-0300) Subject: [media] V4L: Drop bus_type check in v4l2-async match functions X-Git-Tag: firefly_0821_release~176^2~3573^2~1510 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3c2ade017a7e10470aa8112f8a4bfdb2ee30f97f;p=firefly-linux-kernel-4.4.55.git [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 Signed-off-by: Sylwester Nawrocki Signed-off-by: Kyungmin Park Acked-by: Laurent Pinchart Acked-by: Hans Verkuil Acked-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- 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) #if IS_ENABLED(CONFIG_I2C) struct i2c_client *client = i2c_verify_client(dev); return client && - asd->bus_type == V4L2_ASYNC_BUS_I2C && asd->match.i2c.adapter_id == client->adapter->nr && asd->match.i2c.address == client->addr; #else @@ -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) { - return asd->bus_type == V4L2_ASYNC_BUS_PLATFORM && - !strcmp(asd->match.platform.name, dev_name(dev)); + return !strcmp(asd->match.platform.name, dev_name(dev)); } static LIST_HEAD(subdev_list);