diff options
author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-09-27 10:12:00 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-12-29 07:14:28 -0500 |
commit | 4e48afecd5ee3a394d228349fc1c33982e9fb557 (patch) | |
tree | fc426d70b6492b7e254d1c9dcaa550bc8ba79c02 /drivers/media/v4l2-core | |
parent | d651ff916ead5608753f6493dfa3d99ef6e01ab7 (diff) |
media: v4l2-async: simplify v4l2_async_subdev structure
The V4L2_ASYNC_MATCH_FWNODE match criteria requires just one
struct to be filled (struct fwnode_handle). The V4L2_ASYNC_MATCH_DEVNAME
match criteria requires just a device name.
So, it doesn't make sense to enclose those into structs,
as the criteria can go directly into the union.
That makes easier to document it, as we don't need to document
weird senseless structs.
At drivers, this makes even clearer about the match criteria.
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Benoit Parrot <bparrot@ti.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Hyun Kwon <hyun.kwon@xilinx.com>
Acked-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/v4l2-core')
-rw-r--r-- | drivers/media/v4l2-core/v4l2-async.c | 16 | ||||
-rw-r--r-- | drivers/media/v4l2-core/v4l2-fwnode.c | 10 |
2 files changed, 13 insertions, 13 deletions
diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c index e5acfab470a5..2b08d03b251d 100644 --- a/drivers/media/v4l2-core/v4l2-async.c +++ b/drivers/media/v4l2-core/v4l2-async.c @@ -68,12 +68,12 @@ static bool match_i2c(struct v4l2_subdev *sd, struct v4l2_async_subdev *asd) static bool match_devname(struct v4l2_subdev *sd, struct v4l2_async_subdev *asd) { - return !strcmp(asd->match.device_name.name, dev_name(sd->dev)); + return !strcmp(asd->match.device_name, dev_name(sd->dev)); } static bool match_fwnode(struct v4l2_subdev *sd, struct v4l2_async_subdev *asd) { - return sd->fwnode == asd->match.fwnode.fwnode; + return sd->fwnode == asd->match.fwnode; } static bool match_custom(struct v4l2_subdev *sd, struct v4l2_async_subdev *asd) @@ -319,7 +319,7 @@ static bool __v4l2_async_notifier_fwnode_has_async_subdev( if (asd->match_type != V4L2_ASYNC_MATCH_FWNODE) continue; - if (asd->match.fwnode.fwnode == fwnode) + if (asd->match.fwnode == fwnode) return true; } @@ -330,7 +330,7 @@ static bool __v4l2_async_notifier_fwnode_has_async_subdev( if (sd->asd->match_type != V4L2_ASYNC_MATCH_FWNODE) continue; - if (sd->asd->match.fwnode.fwnode == fwnode) + if (sd->asd->match.fwnode == fwnode) return true; } @@ -355,8 +355,8 @@ static bool v4l2_async_notifier_fwnode_has_async_subdev( struct v4l2_async_subdev *other_asd = notifier->subdevs[j]; if (other_asd->match_type == V4L2_ASYNC_MATCH_FWNODE && - asd->match.fwnode.fwnode == - other_asd->match.fwnode.fwnode) + asd->match.fwnode == + other_asd->match.fwnode) return true; } @@ -395,7 +395,7 @@ static int __v4l2_async_notifier_register(struct v4l2_async_notifier *notifier) break; case V4L2_ASYNC_MATCH_FWNODE: if (v4l2_async_notifier_fwnode_has_async_subdev( - notifier, asd->match.fwnode.fwnode, i)) { + notifier, asd->match.fwnode, i)) { dev_err(dev, "fwnode has already been registered or in notifier's subdev list\n"); ret = -EEXIST; @@ -510,7 +510,7 @@ void v4l2_async_notifier_cleanup(struct v4l2_async_notifier *notifier) switch (asd->match_type) { case V4L2_ASYNC_MATCH_FWNODE: - fwnode_handle_put(asd->match.fwnode.fwnode); + fwnode_handle_put(asd->match.fwnode); break; default: WARN_ON_ONCE(true); diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c index fb72c7ac04d4..d630640642ee 100644 --- a/drivers/media/v4l2-core/v4l2-fwnode.c +++ b/drivers/media/v4l2-core/v4l2-fwnode.c @@ -359,9 +359,9 @@ static int v4l2_async_notifier_fwnode_parse_endpoint( return -ENOMEM; asd->match_type = V4L2_ASYNC_MATCH_FWNODE; - asd->match.fwnode.fwnode = + asd->match.fwnode = fwnode_graph_get_remote_port_parent(endpoint); - if (!asd->match.fwnode.fwnode) { + if (!asd->match.fwnode) { dev_warn(dev, "bad remote port parent\n"); ret = -EINVAL; goto out_err; @@ -393,7 +393,7 @@ static int v4l2_async_notifier_fwnode_parse_endpoint( return 0; out_err: - fwnode_handle_put(asd->match.fwnode.fwnode); + fwnode_handle_put(asd->match.fwnode); kfree(asd); return ret == -ENOTCONN ? 0 : ret; @@ -566,7 +566,7 @@ static int v4l2_fwnode_reference_parse( } notifier->subdevs[notifier->num_subdevs] = asd; - asd->match.fwnode.fwnode = args.fwnode; + asd->match.fwnode = args.fwnode; asd->match_type = V4L2_ASYNC_MATCH_FWNODE; notifier->num_subdevs++; } @@ -853,7 +853,7 @@ static int v4l2_fwnode_reference_parse_int_props( } notifier->subdevs[notifier->num_subdevs] = asd; - asd->match.fwnode.fwnode = fwnode; + asd->match.fwnode = fwnode; asd->match_type = V4L2_ASYNC_MATCH_FWNODE; notifier->num_subdevs++; } |