devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Courbot <gnurou@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	Alexandre Courbot <acourbot@nvidia.com>,
	Johan Hovold <johan@kernel.org>,
	Michael Welling <mwelling@ieee.org>,
	Markus Pargmann <mpa@pengutronix.de>,
	Arnd Bergmann <arnd@arndb.de>,
	Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>,
	Grant Likely <grant.likely@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCH] gpio: of: make it possible to name GPIO lines
Date: Thu, 21 Apr 2016 08:25:34 +0900	[thread overview]
Message-ID: <CAAVeFuLeiigGkDngKv+SNM9SAbZtdFvQOCygvZGWwVoMM_q2nQ@mail.gmail.com> (raw)
In-Reply-To: <CACRpkdZ1QJ74qNOntLWrJovTsgNCUn=xFnPLGHmdOFs2PnA7ZQ@mail.gmail.com>

On Thu, Apr 21, 2016 at 7:21 AM, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Wed, Apr 20, 2016 at 3:10 AM, Alexandre Courbot <gnurou@gmail.com> wrote:
>
>>> +               if (!ret)
>>> +                       gdev->descs[i].name = name;
>>
>> Shouldn't we check for name collision (by calling gpio_name_to_desc()
>> as gpiochip_set_desc_names() does) here?
>
> That check is there to avoid getting the same name twice in
> sysfs (which would fail), and this is not for sysfs, it is for the chardev.
>
> And I don't think so: atleast we should not look globally like that thing
> does. It need not be a unique name for the system, but I don't know
> if we should even enforce it to be a unique name for the chip.
>
> What do people think?

As long as we don't need to do things like requesting a GPIO by (chip,
name) tuple, then there should indeed be no issue with having several
lines have the same name.

On the other hand, we want lines to be named precisely, and two lines
with the same name would indicate a lack of precision (they cannot
have *exactly* the same function, can they). So I'm a bit torn as to
whether we should enforce this or not.

      reply	other threads:[~2016-04-20 23:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-19 13:39 [PATCH] gpio: of: make it possible to name GPIO lines Linus Walleij
2016-04-19 14:29 ` Michael Welling
     [not found] ` <1461073157-26574-1-git-send-email-linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-04-20  1:10   ` Alexandre Courbot
2016-04-20 22:21     ` Linus Walleij
2016-04-20 23:25       ` Alexandre Courbot [this message]

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=CAAVeFuLeiigGkDngKv+SNM9SAbZtdFvQOCygvZGWwVoMM_q2nQ@mail.gmail.com \
    --to=gnurou@gmail.com \
    --cc=acourbot@nvidia.com \
    --cc=arnd@arndb.de \
    --cc=bamvor.zhangjian@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=grant.likely@linaro.org \
    --cc=johan@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=mpa@pengutronix.de \
    --cc=mwelling@ieee.org \
    --cc=robh+dt@kernel.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;
as well as URLs for NNTP newsgroup(s).