[Top][All Lists]

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

Re: [Qemu-arm] [PATCH v2 3/7] device_tree: introduce qemu_fdt_node_path

From: David Gibson
Subject: Re: [Qemu-arm] [PATCH v2 3/7] device_tree: introduce qemu_fdt_node_path
Date: Tue, 12 Jan 2016 15:28:56 +1100
User-agent: Mutt/1.5.24 (2015-08-30)

On Mon, Jan 11, 2016 at 11:35:50AM +0100, Eric Auger wrote:
> Hi David,
> On 01/11/2016 03:38 AM, David Gibson wrote:
> > On Wed, Jan 06, 2016 at 03:13:21PM +0000, Eric Auger wrote:
> >> This new helper routine returns the node path of a device
> >> referred to by its node name and compat string.
> > 
> > What if there are multiple nodes matching the name and compat?
> The function would return the first one. I can improve the doc comment.
> Do you think it is a problem stopping at the first one? Is it a real
> life test case I have to handle here?

Well, I don't know of a specific system which will have this, but it's
absolutely possible to get this situation:  e.g. two different PCI
busses, both of which have their own slot 0 populated with different
instances of the same device.

Whether it's possible for platform devices will depend on the
platform's specific bus toplogies, but you certainly can't rule it out
in general.

I could consider adding a new libfdt function like
fdt_node_offset_by_compatible() that searches by name as well.  It's
just I'm not sure that matching by name and compatible isn't a sign of
a poor approach in the caller.

David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!

Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]