lkml.org 
[lkml]   [2023]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v7 3/6] media: starfive: camss: Add basic driver
From
On 19/06/2023 12:28, Jack Zhu wrote:

> +static int stfcamss_of_parse_ports(struct stfcamss *stfcamss)
> +{
> + struct device *dev = stfcamss->dev;
> + struct device_node *node = NULL;
> + int ret, num_subdevs = 0;
> +
> + for_each_endpoint_of_node(dev->of_node, node) {
> + struct stfcamss_async_subdev *csd;
> +
> + if (!of_device_is_available(node))
> + continue;
> +
> + csd = v4l2_async_nf_add_fwnode_remote(&stfcamss->notifier,
> + of_fwnode_handle(node),
> + struct stfcamss_async_subdev);
> + if (IS_ERR(csd)) {
> + ret = PTR_ERR(csd);
> + goto err_cleanup;
> + }
> +
> + ret = stfcamss_of_parse_endpoint_node(dev, node, csd);
> + if (ret < 0)
> + goto err_cleanup;
> +
> + num_subdevs++;
> + }
> +
> + return num_subdevs;
> +
> +err_cleanup:
> + of_node_put(node);

Where is the _get() for this and if you are releasing it on the error
path when is the _get() released on the non-error path ?

> + return ret;
> +}
> +
> +static int stfcamss_subdev_notifier_bound(struct v4l2_async_notifier *async,
> + struct v4l2_subdev *subdev,
> + struct v4l2_async_subdev *asd)
> +{
> + struct media_pad *pad[STF_PADS_NUM];
> + unsigned int i, pad_num = 0;
> +
> + for (i = 0; i < pad_num; ++i) {

Does this loop ever run ?
I don't see how it can..

---
bod

\
 
 \ /
  Last update: 2023-07-26 12:57    [W:0.300 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site