From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexandre Courbot Subject: Re: [PATCH] gpio: of: make it possible to name GPIO lines Date: Thu, 21 Apr 2016 08:25:34 +0900 Message-ID: References: <1461073157-26574-1-git-send-email-linus.walleij@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: Sender: linux-gpio-owner@vger.kernel.org To: Linus Walleij Cc: "linux-gpio@vger.kernel.org" , Alexandre Courbot , Johan Hovold , Michael Welling , Markus Pargmann , Arnd Bergmann , Bamvor Jian Zhang , Grant Likely , Rob Herring , "devicetree@vger.kernel.org" List-Id: devicetree@vger.kernel.org On Thu, Apr 21, 2016 at 7:21 AM, Linus Walleij wrote: > On Wed, Apr 20, 2016 at 3:10 AM, Alexandre Courbot 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.