[U-Boot] [RFC PATCH] dm: ensure device names are unique

Stephen Warren swarren at wwwdotorg.org
Thu Apr 28 17:55:32 CEST 2016


On 04/27/2016 10:50 PM, Simon Glass wrote:
> Hi Stephen,
>
> On 26 April 2016 at 15:30, Stephen Warren wrote:
>  > It is possible for HW to contain multiple instances of the same device. In
>  > this case, the name passed to device_bind() may not be unique across all
>  > devices within its uclass. One example is a system with multiple  identical
>  > PCI Ethernet devices. Another might be a system with multiple identical
>  > I2C GPIO expanders, each connected to a separate I2C bus, yet using the
>  > same I2C address on that bus and hence having the same DT node name.
>  >
>  > Enhance the code to detect this situation, and append a sequence  number so
>  > the device name to ensure uniqueness.
>  >
>  > Signed-off-by: Stephen Warren <swarren at nvidia.com <swarren at nvidia.com>>
>
> I would rather that the caller handles this. But failing this perhaps a
> new function that does it? Is this for the Ethernet use case?

Wouldn't all callers of this function simply call the new function? I'm 
not aware of any case where the code to avoid duplicate names would not 
be desired.

I hit this for the Ethernet case, but I believe it applies to any type 
of device at all; see another possible trigger case in the commit 
description.


More information about the U-Boot mailing list