Re: [RFC/PATCH] of: platform: Remove unique device name enforcement

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

 




On Sun, May 18, 2014 at 12:01 PM, Ezequiel Garcia
<ezequiel@xxxxxxxxxxxxxxxxxxxx> wrote:
> When creating a device object for a devicetree node, the device name
> is created by using the node name and the 'reg' property, to make a name
> such as "a000.foo_device".
>
> For certain devices without an associated address, and hence no 'reg' property,
> the current code attempts to make a unique name, by using a global integer.
> Names look like "foo_device.1", "bar_device.2", and so on.
> Examples of such devices are: gpio-keys', backlights and rotary-encoders.
>
> The system cannot know such devices name before hand, given they are determined
> by the kernel probe order and by the nodes present in the devicetree. This can
> be problematic, on systems that are tied to the device's name, e.g. when
> catching hotplug events.
>
> In order to fix the name, this commit removes the global integer uniqueness
> enforcement and instead uses the node name for the device name. The rationale
> behind such change, is that there's no way two nodes with the same node name
> are associated to two different devices, by the nature of the devicetree.
> In other words, it's impossible to produce a name collision for these kind
> of devices.

This is perfectly legal:

/bus1/device
/bus2/device

Only the full name has to be unique.

>
> Signed-off-by: Ezequiel Garcia <ezequiel@xxxxxxxxxxxxxxxxxxxx>
> ---
> Hello Grant, Rob:
>
> I'm pretty sure there's a good reason for the existence of the atomic magic
> integer, so this is not a *real* patch, but rather a bold attempt at asking you
> some explanations for this.
>
> Under what circumstances does the magic integer avoids a name collision?
> Will this propposal introduce a regression?

See the recent changes to this function in linux-next and the
associated discussion of those commits.

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux