From: =?UTF-8?Q?Andr=c3=a9_Przywara?= Date: Sun, 23 Jul 2017 21:31:00 +0100 Subject: [U-Boot] [PATCH 3/6] libfdt: add fdtdec_lookup_phandle_index() In-Reply-To: References: <1499043558-9336-1-git-send-email-andre.przywara@arm.com> <1499043558-9336-4-git-send-email-andre.przywara@arm.com> Message-ID: <660d9dd3-9df8-4f95-a379-8f07f2bb21c8@arm.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 07/07/17 04:58, Simon Glass wrote: Hi Simon, > On 2 July 2017 at 18:59, Andre Przywara wrote: >> In some bindings a property points to multiple nodes, using a list of >> phandles. A prominent example are UART pinctrl nodes, which use one node >> to contain the RX/TX pins and another node to describe the lines used >> for the hardware handshake. >> The current fdtdec_lookup_phandle() helper function to chase a phandle >> is quite convienent, but can only lookup the first of those handles. >> >> Introduce an extra function fdtdec_lookup_phandle_index() to take an >> index parameter and implement fdtdec_lookup_phandle() as a special case >> of that. >> >> Signed-off-by: Andre Przywara >> --- >> include/fdtdec.h | 12 ++++++++++++ >> lib/fdtdec.c | 16 ++++++++++++---- >> 2 files changed, 24 insertions(+), 4 deletions(-) > > Can you please: > > - Add a dev_read... version of this API > - Also ofnode_... Mmmh, I am not sure I follow here. I find that both dev_read_phandle_with_args() and ofnode_parse_phandle_with_args() take an index parameter already and from briefly looking at the code seem to do the right thing already. So I guess that's not what you meant? What am I missing? Cheers, Andre.