From: Ezequiel Garcia <ezequiel-30ULvvUtt6G51wMPkGsGjgyUoB5FGQPZ@public.gmane.org>
To: Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: "Grant Likely"
<grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>,
"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"Rob Herring" <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
"Guido Martínez"
<guido-30ULvvUtt6G51wMPkGsGjgyUoB5FGQPZ@public.gmane.org>
Subject: Re: [RFC/PATCH] of: platform: Remove unique device name enforcement
Date: Tue, 20 May 2014 15:37:29 -0300 [thread overview]
Message-ID: <20140520183729.GA17353@arch.cereza> (raw)
In-Reply-To: <CAL_JsqJHhJ1ba5tOGnsNNp1DhPwnJWh8F9f2xL8b3FYj=kC1hA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On 20 May 01:30 PM, Rob Herring wrote:
> On Tue, May 20, 2014 at 1:50 AM, Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org> wrote:
> > On Sun, 18 May 2014 18:11:07 -0500, Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> >> On Sun, May 18, 2014 at 12:01 PM, Ezequiel Garcia
> >> <ezequiel-30ULvvUtt6G51wMPkGsGjgyUoB5FGQPZ@public.gmane.org> 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.
> >
> > The device's uevent file in sysfs contains both the ->name and
> > ->full_name values for a node. Does that help you?
> >
> > The big problem is not the structure under /sys/devices, but rather the
> > symlinks to devices that appear under /sys/bus/*/devices. If two leaf
> > nodes have the same name, then they will conflict when they get added to
> > a bus_type's array of devices.
> >
> > Another way to handle it is to only add the suffix when a conflict
> > actually occurs. That requires checking first whether or not a name will
> > conflict and ammending it only when that happens. I don't know if that
> > can be done nicely. I'll take a look.
>
> That was my idea as well and to move to a local number so you have
> something like deviceA, deviceA.1, deviceB, deviceB.1 (maybe the
> number is always appended). Perhaps a random number instead so no one
> expects the names to be an ABI. ;)
>
> I think it should be doable.
>
That would be very nice :)
--
Ezequiel Garcia, VanguardiaSur
www.vanguardiasur.com.ar
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-05-20 18:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-18 17:01 [RFC/PATCH] of: platform: Remove unique device name enforcement Ezequiel Garcia
[not found] ` <1400432516-6802-1-git-send-email-ezequiel-30ULvvUtt6G51wMPkGsGjgyUoB5FGQPZ@public.gmane.org>
2014-05-18 23:11 ` Rob Herring
[not found] ` <CAL_JsqJKDFJDsGbhB-=W=ujgoRpnJGcJ9a74uhHjj4KFvRK=gg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-20 6:50 ` Grant Likely
[not found] ` <20140520065014.493C3C412E3-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2014-05-20 18:30 ` Rob Herring
[not found] ` <CAL_JsqJHhJ1ba5tOGnsNNp1DhPwnJWh8F9f2xL8b3FYj=kC1hA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-20 18:37 ` Ezequiel Garcia [this message]
2014-05-21 0:53 ` Grant Likely
[not found] ` <20140521005357.4CAE4C418EF-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2014-05-21 2:23 ` Grant Likely
2014-05-21 7:43 ` Grant Likely
[not found] ` <20140521074353.C8B79C4198A-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2014-05-22 15:57 ` Ezequiel Garcia
2014-05-22 18:31 ` Rob Herring
[not found] ` <CAL_Jsq+pratjukD77FJHyHG5WST=zB=zcUgbpo-sA8X=uCojpA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-23 2:48 ` Grant Likely
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140520183729.GA17353@arch.cereza \
--to=ezequiel-30ulvvutt6g51wmpkgsgjgyuob5fgqpz@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
--cc=guido-30ULvvUtt6G51wMPkGsGjgyUoB5FGQPZ@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.