From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: linux-media@vger.kernel.org
Cc: "Niklas Söderlund" <niklas.soderlund@ragnatech.se>,
"Kieran Bingham" <kieran.bingham+renesas@ideasonboard.com>,
"Andrey Konovalov" <andrey.konovalov@linaro.org>
Subject: [PATCH 4/6] media: v4l2-fwnode: Simplify v4l2_async_nf_parse_fwnode_endpoints()
Date: Tue, 22 Jun 2021 14:21:58 +0300 [thread overview]
Message-ID: <20210622112200.13914-5-sakari.ailus@linux.intel.com> (raw)
In-Reply-To: <20210622112200.13914-1-sakari.ailus@linux.intel.com>
From: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
There are only one user left of __v4l2_async_nf_parse_fwnode_ep()
since [1], v4l2_async_nf_parse_fwnode_endpoints(). The two
functions can be merged.
The merge of the two highlights a dead code block conditioned by the
argument 'has_port' that always is false and can therefor be removed.
1. commit 0ae426ebd0dcef81 ("media: v4l2-fwnode: Remove v4l2_async_notifier_parse_fwnode_endpoints_by_port()")
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
[Sakari Ailus: Aligned some lines to opening parentheses.]
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
drivers/media/v4l2-core/v4l2-fwnode.c | 31 +++++----------------------
1 file changed, 5 insertions(+), 26 deletions(-)
diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c
index e5507501b0f3..00457e1e93f6 100644
--- a/drivers/media/v4l2-core/v4l2-fwnode.c
+++ b/drivers/media/v4l2-core/v4l2-fwnode.c
@@ -839,12 +839,11 @@ v4l2_async_nf_fwnode_parse_endpoint(struct device *dev,
return ret == -ENOTCONN ? 0 : ret;
}
-static int
-__v4l2_async_nf_parse_fwnode_ep(struct device *dev,
- struct v4l2_async_notifier *notifier,
- size_t asd_struct_size, unsigned int port,
- bool has_port,
- parse_endpoint_func parse_endpoint)
+int
+v4l2_async_nf_parse_fwnode_endpoints(struct device *dev,
+ struct v4l2_async_notifier *notifier,
+ size_t asd_struct_size,
+ parse_endpoint_func parse_endpoint)
{
struct fwnode_handle *fwnode;
int ret = 0;
@@ -862,16 +861,6 @@ __v4l2_async_nf_parse_fwnode_ep(struct device *dev,
if (!is_available)
continue;
- if (has_port) {
- struct fwnode_endpoint ep;
-
- ret = fwnode_graph_parse_endpoint(fwnode, &ep);
- if (ret)
- break;
-
- if (ep.port != port)
- continue;
- }
ret = v4l2_async_nf_fwnode_parse_endpoint(dev, notifier,
fwnode,
@@ -885,16 +874,6 @@ __v4l2_async_nf_parse_fwnode_ep(struct device *dev,
return ret;
}
-
-int
-v4l2_async_nf_parse_fwnode_endpoints(struct device *dev,
- struct v4l2_async_notifier *notifier,
- size_t asd_struct_size,
- parse_endpoint_func parse_endpoint)
-{
- return __v4l2_async_nf_parse_fwnode_ep(dev, notifier, asd_struct_size,
- 0, false, parse_endpoint);
-}
EXPORT_SYMBOL_GPL(v4l2_async_nf_parse_fwnode_endpoints);
/*
--
2.30.2
next prev parent reply other threads:[~2021-06-22 11:28 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-22 11:21 [PATCH 0/6] V4L2 driver documentation, v4l2-async improvements Sakari Ailus
2021-06-22 11:21 ` [PATCH 1/6] Documentation: media: Improve camera sensor documentation Sakari Ailus
2021-06-23 15:11 ` Jacopo Mondi
2021-06-23 15:50 ` Sakari Ailus
2021-06-24 4:50 ` Andrey Konovalov
2021-06-24 8:11 ` Sakari Ailus
2021-06-22 11:21 ` [PATCH 2/6] Documentation: media: Fix v4l2-async kerneldoc syntax Sakari Ailus
2021-06-23 15:13 ` Jacopo Mondi
2021-06-22 11:21 ` [PATCH 3/6] v4l: async: Rename async nf functions, clean up long lines Sakari Ailus
2021-06-22 19:02 ` kernel test robot
2021-06-22 20:47 ` kernel test robot
2021-06-23 8:10 ` [PATCH v2 " Sakari Ailus
2021-06-22 11:21 ` Sakari Ailus [this message]
2021-06-23 15:13 ` [PATCH 4/6] media: v4l2-fwnode: Simplify v4l2_async_nf_parse_fwnode_endpoints() Jacopo Mondi
2021-06-22 11:21 ` [PATCH 5/6] media: rcar-vin: Remove explicit device availability check Sakari Ailus
2021-06-23 15:14 ` Jacopo Mondi
2021-06-22 11:22 ` [PATCH 6/6] Documentation: v4l: Fix V4L2_CID_PIXEL_RATE documentation Sakari Ailus
2021-06-23 15:15 ` Jacopo Mondi
2021-06-24 5:22 ` Andrey Konovalov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210622112200.13914-5-sakari.ailus@linux.intel.com \
--to=sakari.ailus@linux.intel.com \
--cc=andrey.konovalov@linaro.org \
--cc=kieran.bingham+renesas@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=niklas.soderlund@ragnatech.se \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox