media: qcom: camss: use a handy v4l2_async_nf_add_fwnode_remote() function

Another code simplification makes parsing of remote endpoints easy.

Tested-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
Vladimir Zapolskiy 2025-11-20 02:46:04 +02:00 committed by Hans Verkuil
parent eccf5fa8e3
commit 77a2ff40c5

View File

@ -4271,18 +4271,9 @@ static int camss_parse_ports(struct camss *camss)
fwnode_graph_for_each_endpoint(fwnode, ep) {
struct camss_async_subdev *csd;
struct fwnode_handle *remote;
remote = fwnode_graph_get_remote_port_parent(ep);
if (!remote) {
dev_err(dev, "Cannot get remote parent\n");
ret = -EINVAL;
goto err_cleanup;
}
csd = v4l2_async_nf_add_fwnode(&camss->notifier, remote,
struct camss_async_subdev);
fwnode_handle_put(remote);
csd = v4l2_async_nf_add_fwnode_remote(&camss->notifier, ep,
typeof(*csd));
if (IS_ERR(csd)) {
ret = PTR_ERR(csd);
goto err_cleanup;