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>
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;