Hi Sakari,

Thanks for your work.

On 2019-03-18 21:16:48 +0200, Sakari Ailus wrote:
> Shorten v4l2_async_notifier_fwnode_parse_endpoint by using
> v4l2_async_notifier_add_fwnode_remote_subdev.
> 
> Signed-off-by: Sakari Ailus <sakari.ai...@linux.intel.com>
> ---
>  drivers/media/v4l2-core/v4l2-fwnode.c | 12 ++----------
>  1 file changed, 2 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c 
> b/drivers/media/v4l2-core/v4l2-fwnode.c
> index 27827842dffd..74af7065996a 100644
> --- a/drivers/media/v4l2-core/v4l2-fwnode.c
> +++ b/drivers/media/v4l2-core/v4l2-fwnode.c
> @@ -615,15 +615,6 @@ v4l2_async_notifier_fwnode_parse_endpoint(struct device 
> *dev,
>       if (!asd)
>               return -ENOMEM;
>  
> -     asd->match_type = V4L2_ASYNC_MATCH_FWNODE;
> -     asd->match.fwnode =
> -             fwnode_graph_get_remote_endpoint(endpoint);
> -     if (!asd->match.fwnode) {
> -             dev_dbg(dev, "no remote endpoint found\n");
> -             ret = -ENOTCONN;
> -             goto out_err;
> -     }
> -

This change breaks rcar-vin I'm afraid :-(

A bit further down in v4l2_async_notifier_fwnode_parse_endpoint() we 
have this section.

    ret = parse_endpoint ? parse_endpoint(dev, &vep, asd) : 0;
    if (ret == -ENOTCONN)
        dev_err(dev, "ignoring port@%u/endpoint@%u\n", vep.base.port,
            vep.base.id);
    ...
    if (ret < 0)
        goto out_err;


As rcar-vin uses the information in asd in its parse_endpoint() callback 
and fails if it can't interact with it. So nothing is registers with the 
notifier and not much happens after that. Is the rcar-vin driver wrong 
in assuming the asd should be populated when the callback is called?

>       ret = v4l2_fwnode_endpoint_alloc_parse(endpoint, &vep);
>       if (ret) {
>               dev_warn(dev, "unable to parse V4L2 fwnode endpoint (%d)\n",
> @@ -643,7 +634,8 @@ v4l2_async_notifier_fwnode_parse_endpoint(struct device 
> *dev,
>       if (ret < 0)
>               goto out_err;
>  
> -     ret = v4l2_async_notifier_add_subdev(notifier, asd);
> +     ret = v4l2_async_notifier_add_fwnode_remote_subdev(notifier, endpoint,
> +                                                        asd);
>       if (ret < 0) {
>               /* not an error if asd already exists */
>               if (ret == -EEXIST)
> -- 
> 2.11.0
> 

-- 
Regards,
Niklas Söderlund

Reply via email to