The driver parsed, besides its own endpoint on the sink, the remote
upstream endpoint that most likely is a sensor, and took the number of
lanes from that. Instead obtain the number of lanes from the local
endpoint.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: Wentong Wu <wentong.wu@intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
                return -EINVAL;
        }
 
+       csi->nr_of_lanes = v4l2_ep.bus.mipi_csi2.num_data_lanes;
+
        fwnode = fwnode_graph_get_remote_endpoint(ep);
        fwnode_handle_put(ep);
 
                return PTR_ERR(asd);
        }
 
-       ret = v4l2_fwnode_endpoint_alloc_parse(fwnode, &v4l2_ep);
        fwnode_handle_put(fwnode);
-       if (ret)
-               return ret;
-       csi->nr_of_lanes = v4l2_ep.bus.mipi_csi2.num_data_lanes;
 
        ret = v4l2_async_nf_register(&csi->notifier);
        if (ret)
                v4l2_async_nf_cleanup(&csi->notifier);
 
-       v4l2_fwnode_endpoint_free(&v4l2_ep);
-
        return ret;
 }