lkml.org 
[lkml]   [2020]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 02/18] property: Add support for calling fwnode_graph_get_endpoint_by_id() for fwnode->secondary
From
Date
On 30/11/2020 17:29, Andy Shevchenko wrote:
> On Mon, Nov 30, 2020 at 01:31:13PM +0000, Daniel Scally wrote:
>> This function is used to find fwnode endpoints against a device. In
>> some instances those endpoints are software nodes which are children of
>> fwnode->secondary. Add support to fwnode_graph_get_endpoint_by_id() to
>> find those endpoints by recursively calling itself passing the ptr to
>> fwnode->secondary in the event no endpoint is found for the primary.
>
> One nit below, after addressing:
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>
> ...
>
>> + 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.

Thanks - I made this change too

\
 
 \ /
  Last update: 2020-12-02 11:17    [W:0.204 / U:0.804 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site