Devicetree
 help / color / mirror / Atom feed
From: Ezequiel Garcia <ezequiel-30ULvvUtt6G51wMPkGsGjgyUoB5FGQPZ@public.gmane.org>
To: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
Cc: "Rob Herring"
	<robherring2-Re5JQEeQqe8AvxtiuMwx3w@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: Thu, 22 May 2014 12:57:06 -0300	[thread overview]
Message-ID: <20140522155706.GB1785@arch.cereza> (raw)
In-Reply-To: <20140521074353.C8B79C4198A-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>

On 21 May 04:43 PM, Grant Likely wrote:
[..]
> 
> Yet another approach. How about this patch? If the unit address cannot
> be translated, then append the translated name of the parent.
> 
[..]
> 
> commit 177e5ff131639c8568248e5b9b2380066ce305d6
> Author: Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> Date:   Wed May 21 15:40:31 2014 +0900
> 
>     of: Ensure unique names without sacrificing determinism
>     
>     The way the driver core is implemented, every device using the same bus
>     type is required to have a unique name because a symlink to each device
>     is created in the appropriate /sys/bus/*/devices directory, and two
>     identical names causes a collision.
>     
>     The current code handles the requirement by using an globally
>     incremented counter that is appended to the device name. It works, but
>     it means any change to device registration will change the assigned
>     numbers. Instead, if we build up the name by using information from the
>     parent nodes, then it can be guaranteed to be unique without adding a
>     random number to the end of it.
>     
>     Signed-off-by: Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> 

This solves the issue I complained about. Now the names of the devices match
the name of nodes, so the system knows what names to expect.

Before:

$ ls /sys/devices/
44e10800.pinmux   gpio-keys.8       pmu.0             system
ARMv7 Cortex-A8   hdmi.5            rotary-encoder.9  userhelper.10
backlight.6       ocp.3             soc.1             virtual
breakpoint        panel.7           soc0
fixedregulator.4  platform          software

After:

$ ls /sys/devices/
44e10800.pinmux   gpio-keys         pmu               system
ARMv7 Cortex-A8   hdmi              rotary-encoder    userhelper
backlight         ocp               soc               virtual
breakpoint        panel             soc0
fixedregulator@0  platform          software

Tested-by: Ezequiel Garcia <ezequiel-30ULvvUtt6G51wMPkGsGjgyUoB5FGQPZ@public.gmane.org>

It would be great if this patch could be merged.

Thanks a lot Grant,
-- 
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

  parent reply	other threads:[~2014-05-22 15:57 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
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 [this message]
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=20140522155706.GB1785@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox