media: stm32: csi: remove useless fwnode_graph_get_endpoint call
The endpoint is already retrieved at the beginning of the function stm32_csi_parse_dt hence keep the endpoint pointer until the end instead of getting a new one. Signed-off-by: Alain Volmat <alain.volmat@foss.st.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
This commit is contained in:
committed by
Hans Verkuil
parent
e0c2081221
commit
1ec16c335c
@@ -932,38 +932,32 @@ static int stm32_csi_parse_dt(struct stm32_csi_dev *csidev)
|
||||
}
|
||||
|
||||
ret = v4l2_fwnode_endpoint_parse(ep, &v4l2_ep);
|
||||
fwnode_handle_put(ep);
|
||||
if (ret) {
|
||||
dev_err(csidev->dev, "Could not parse v4l2 endpoint\n");
|
||||
return ret;
|
||||
goto out;
|
||||
}
|
||||
|
||||
csidev->num_lanes = v4l2_ep.bus.mipi_csi2.num_data_lanes;
|
||||
if (csidev->num_lanes > STM32_CSI_LANES_MAX) {
|
||||
dev_err(csidev->dev, "Unsupported number of data-lanes: %d\n",
|
||||
csidev->num_lanes);
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
memcpy(csidev->lanes, v4l2_ep.bus.mipi_csi2.data_lanes,
|
||||
sizeof(csidev->lanes));
|
||||
|
||||
ep = fwnode_graph_get_next_endpoint(dev_fwnode(csidev->dev), NULL);
|
||||
if (!ep) {
|
||||
dev_err(csidev->dev, "Failed to get next endpoint\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
v4l2_async_subdev_nf_init(&csidev->notifier, &csidev->sd);
|
||||
|
||||
asd = v4l2_async_nf_add_fwnode_remote(&csidev->notifier, ep,
|
||||
struct v4l2_async_connection);
|
||||
|
||||
fwnode_handle_put(ep);
|
||||
|
||||
if (IS_ERR(asd)) {
|
||||
dev_err(csidev->dev, "Failed to add fwnode remote subdev\n");
|
||||
return PTR_ERR(asd);
|
||||
ret = PTR_ERR(asd);
|
||||
goto out;
|
||||
}
|
||||
|
||||
csidev->notifier.ops = &stm32_csi_notifier_ops;
|
||||
@@ -972,9 +966,11 @@ static int stm32_csi_parse_dt(struct stm32_csi_dev *csidev)
|
||||
if (ret) {
|
||||
dev_err(csidev->dev, "Failed to register notifier\n");
|
||||
v4l2_async_nf_cleanup(&csidev->notifier);
|
||||
return ret;
|
||||
goto out;
|
||||
}
|
||||
|
||||
out:
|
||||
fwnode_handle_put(ep);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user