Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1154889ybk; Sat, 16 May 2020 02:45:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSyUOUWIGOjsyZ2B3kSt4h0wg0lZHSi86KkORclhpS54z7yyvNpOqHQOPThoneFX65vh4o X-Received: by 2002:a50:9e6a:: with SMTP id z97mr5898032ede.375.1589622359248; Sat, 16 May 2020 02:45:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589622359; cv=none; d=google.com; s=arc-20160816; b=DUhtQFqififZ3qw3Z4FMj6EAqhZRr5UQzcXGhcckgTGLP1WslZMKXaM67GpGslNLkV qUj8N1GkhWfD6UBAA4c8jGQ3JWNpjQyU0Z2dITsccqkho/y+xYi+bHDXZcqAhAa92fVj ZmY37NJ7MuyIcrPhmrMbwLYQRr3kaCTmaKZuVDKfeiiFJrNMQyd4+O5RQSrlL7HXcFir G4G+bRFaqYLi0yb2jZkoi+/3+k74nppmi4a8vXfmP+fwMyNlE5Y8nDARvlouDP510yFT BrSWJb7tmXSA/frqcDyt5X5xtWNfGhcTvyWji2859n79dBpIUQqEPge+mMM01xyLWWzB LaaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ETnQEurEj2D9S0skz5vWgXCGMnqttYf8X7vq+AyGws4=; b=wiIAjPagTxIsc+U8y1lg9p1Acl/hrjUMt3/icF6KyRgvJh46p35mOq4JnB+KcIMGvD Qp8oFjp4/71UOev2lX/p+49xv+eXeBfEcmat8UmiM1qYr5e413uL2AuIqqXT7Pt5Ca7n PXE+0uD4pOBLAsTkfzPgn5LoBg6/nyQ/9YUzEIyWySYrDHe4ilD0FgSbSnmLKXjtFeOt jqxSlRklh7ZprREQeOmVvWxE6cB+yqKejN57+Xe/Ky0VedoACWZr/+NJmp9S4CKpcOsY 8vvD0KccvJIW2X5lBHyCpJEGDXz/XBJBMvfHg61dCOYvI0t7brw75IM6JeWuKVKvMcg8 Wn0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hbdzU3b1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i7si2677808edb.520.2020.05.16.02.45.34; Sat, 16 May 2020 02:45:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hbdzU3b1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726703AbgEPJlq (ORCPT + 99 others); Sat, 16 May 2020 05:41:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725997AbgEPJlq (ORCPT ); Sat, 16 May 2020 05:41:46 -0400 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFC96C061A0C for ; Sat, 16 May 2020 02:41:44 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id f18so4754051lja.13 for ; Sat, 16 May 2020 02:41:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=ETnQEurEj2D9S0skz5vWgXCGMnqttYf8X7vq+AyGws4=; b=hbdzU3b1sUtVTpY94DKNXrGnHP3CM6+4lLyAdYNx6YAjjHqouc3xqKHTr1Kora27l8 s+PGJ/ZkScqc5OhvSCPkV40a/pB2zVYyJ4k7SlmIs1O71UYd27JLlmN0EVhourGSv2kJ GR7Jd+MZqulDetVv923CZqSAmratk3mzrAawCcTdNNNPtcXOjL8ro4Z9S4scL0CHunwv aiK6LXOUXNNdlWwbNsQkqm4RMrRR10z/NKwzL0wPK2vJ06ACPNFoVi6OirpuEnOCrwoH WhTQKduxvKAkMo4jyO7pDUZFCth2yvlIGaD3Igog/6fpitpBsqJjNvQ3vn8OGGdRhmrj /r2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=ETnQEurEj2D9S0skz5vWgXCGMnqttYf8X7vq+AyGws4=; b=GEWi8tcXgsGsYy8Org0OOJ99FTu64IXFvpnDkvjaD/p6GQwAPLPDdlSHOOwpZ87khs beJ3nJPI4Qa2E5XUX7kDyi/uHY2vKigrWujwoIfibLoocZ3YxUGUog7dQ4bJ56KrRnpv +BtJHuAsoyqjRULJWy2N74z4TZMxE5Q7AermWmEfRRnxkDkVxNKETR6mPrLKC0L6vLId m9VcPsbkMsb4OukPhaJtxVnO5ymaMD2/i8WwSjNTjr8vJTB/jMH9Dr8G/ReM8wGEI1fp AImPBBspdJOPBRGYmmWQN8fMhqEenDhxOW82teF3hlhnYhgXKMw4duD2ulT0vj3NuHK2 Cn9A== X-Gm-Message-State: AOAM532/wzdGdVJI40cy4p2JWCkAXIqrlPq6vIZyDiVgzDUt45CONBkN fwRqjF5ZfSjolWQzPBgUKHKfqN8XJysNlO+YtzRzGQ== X-Received: by 2002:a2e:8805:: with SMTP id x5mr5010874ljh.223.1589622100904; Sat, 16 May 2020 02:41:40 -0700 (PDT) MIME-Version: 1.0 References: <20200511101828.30046-1-geert+renesas@glider.be> In-Reply-To: From: Linus Walleij Date: Sat, 16 May 2020 11:41:30 +0200 Message-ID: Subject: Re: [PATCH] gpiolib: Document that GPIO line names are not globally unique To: Bartosz Golaszewski Cc: Geert Uytterhoeven , linux-gpio , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 12, 2020 at 12:43 PM Bartosz Golaszewski wrote: > pon., 11 maj 2020 o 12:18 Geert Uytterhoeven > napisa=C5=82(a): > > > > gpiochip_set_desc_names() no longer rejects GPIO line name collisions. > > Hence GPIO line names are not guaranteed to be globally unique. > > In case of multiple GPIO lines with the same name, gpio_name_to_desc() > > will return the first match found. (...) > This makes me wonder whether I should do something about this in > libgpiod? Looks to me like gpiod_chip_find_line() and the global > gpiod_line_find() are no longer reliable and should probably return > all lines whose names match. Hm. You probably know how consumers of libgpiod work better than me. The background is historical and this happens because gpiolib had a mechanism to name lines before I even took over maintenance, and that did not require line names to be unique. So when I created the character device I had to face the fact. We also had to deal with the fact that when naming lines, the "NULL alternative" (no name on the line at all) is always a valid fallback. And all lines named NULL are still valid and all have the same name so... Yours, Linus Walleij