From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [RFC 01/24] xen/char: dt-uart: Allow the user to give a path to the node Date: Mon, 19 Aug 2013 16:09:46 +0100 Message-ID: <5212353A.8060700@linaro.org> References: <1376687156-6737-1-git-send-email-julien.grall@linaro.org> <1376687156-6737-2-git-send-email-julien.grall@linaro.org> <520E98D7.6010405@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <520E98D7.6010405@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andre Przywara Cc: patches@linaro.org, xen-devel@lists.xen.org, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On 08/16/2013 10:25 PM, Andre Przywara wrote: > On 08/16/2013 11:05 PM, Julien Grall wrote: >> On some board, there is no alias to the UART. To avoid modification in >> the device tree, dt-uart should also search device by path. > > Funny, it wrote almost the same patch two days ago (including the > variable renaming, minus the "/" check). Thanks for saving me the > cleanup and send-out ;-) > It is really useful for Midway! > >> To distinguish an alias from a path, dt-uart will check the first >> character. >> If it's a / then it's path, otherwise it's an alias. > > Is that really needed? In my patch I just try it as an alias first, if > there is no match (dev == NULL), I try the full path. > Are there any ambiguities expected between an alias and a full path? Following the ePAPR documentation (section 2.2.4), the name property can't contain '/' in the name. I choose this solution, because I want to avoid to call the 2 functions if it's possible. It's a waste of time to call both if we know that the path always start with a '/' and alias not. Cheers, -- Julien Grall