Re: [PATCH 02/18] property: Add support for calling fwnode_graph_get_endpoint_by_id() for fwnode->secondary

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

 



On Mon, Nov 30, 2020 at 07:28:57PM +0200, Laurent Pinchart wrote:
> On Mon, Nov 30, 2020 at 07:29:00PM +0200, Andy Shevchenko wrote:
> > On Mon, Nov 30, 2020 at 01:31:13PM +0000, Daniel Scally wrote:

...

> > > +	if (!best_ep && fwnode && !IS_ERR_OR_NULL(fwnode->secondary))
> > > +		return fwnode_graph_get_endpoint_by_id(fwnode->secondary, port,
> > > +						       endpoint, flags);
> > 
> > >  	return best_ep;
> > 
> > Can we, please, do
> > 
> > 	if (best_ep)
> > 		return best_ep;
> > 
> > 	if (fwnode && !IS_ERR_OR_NULL(fwnode->secondary))
> > 		return fwnode_graph_get_endpoint_by_id(fwnode->secondary, port,
> > 						       endpoint, flags);
> > 
> > 	return NULL;
> > 
> > ?
> > 
> > This 'if (fwnode && !IS_ERR_OR_NULL(fwnode->secondary))' becomes kinda
> > idiomatic to the cases when we need to proceed primary followed by the
> > secondary in cases where it's not already done.
> 
> We could also move the !fwnode check to the beginning of the function.

It's already there (1). What did I miss?

1) via fwnode_graph_get_next_endpoint() -> fwnode_call_ptr_op()

-- 
With Best Regards,
Andy Shevchenko





[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