Re: [RFC 4/8] omap3isp: Rework OF endpoint parsing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Hans,

Thank you for reviewing this.

On Thu, Apr 04, 2019 at 03:43:51PM +0200, Hans Verkuil wrote:
> On 3/18/19 8:16 PM, Sakari Ailus wrote:
...
> > +static int isp_parse_of_endpoints(struct isp_device *isp)
> > +{
> > +	struct fwnode_handle *ep;
> > +	struct isp_async_subdev *isd;
> > +	struct isp_bus_cfg *buscfg;
> > +	unsigned int i;
> > +
> > +	ep = fwnode_graph_get_endpoint_by_id(
> > +		dev_fwnode(isp->dev), ISP_OF_PHY_PARALLEL, 0,
> > +		FWNODE_GRAPH_ENDPOINT_NEXT);
> > +
> > +	if (ep) {
> > +		struct v4l2_fwnode_endpoint vep = {
> > +			.bus_type = V4L2_MBUS_PARALLEL
> > +		};
> > +		int ret;
> > +
> > +		dev_dbg(isp->dev, "parsing parallel interface\n");
> > +
> > +		ret = v4l2_fwnode_endpoint_parse(ep, &vep);
> > +		if (!ret)
> > +			ret = isp_alloc_isd(&isd, &buscfg);
> > +
> > +		if (!ret) {
> > +			isp_parse_of_parallel_endpoint(isp->dev, &vep, buscfg);
> > +			ret = v4l2_async_notifier_add_fwnode_remote_subdev(
> > +				&isp->notifier, ep, &isd->asd);
> > +		}
> > +
> > +		if (ret) {
> > +			kfree(isd);
> > +			fwnode_handle_put(ep);
> > +		}
> 
> If ret == 0, then who calls 'fwnode_handle_put(ep);'?
> 
> Am I missing something?

Good question. The reference is released when the notifier is eventually
cleaned up. That's not very intuitive. I'll see if I could address that in
the next version.

-- 
Sakari Ailus
sakari.ailus@xxxxxxxxxxxxxxx



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux