From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8622C330330 for ; Tue, 30 Jun 2026 16:06:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782835588; cv=none; b=se9a/41mMLOil2D7SHSQ1qitU3dMJJzjWK/CNn0r+vtHnDNQxl2tUrYoygwa7oGhyhxl3lNyqAmhrA4lwIIJ3xOIqAP/Ki73iRVsVkHZUkOkjouCebm1FrESt2Jc/yCpUUh6wUYY1RSwKQYIQ393vQtaCB0BCPt5YPxAt3vIaCQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782835588; c=relaxed/simple; bh=y9uuZkEeJae++MbeR+TNLsbet2X1rPdv40pKLNu47dg=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=TSjarEBZW6yET6Ff2R1xXEQdagdNYSqqpFI1Jp9fhNThsd823mNgzFDJMmVLzTQ/6ShJ344LQvRb2L/xS3ykf1vge67sOAtMyGrJwbQPr6W78UnPzG9VqMGBgejzMxx07h9WnFw02rGUXW4JHcmHEM3WTtqPSuo+suFYikTEOY4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-2c9d87b1f9eso18089625ad.3 for ; Tue, 30 Jun 2026 09:06:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782835587; x=1783440387; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=vqnNDF5VKQ+E0vRBcJ/LtO+JWbWwBxQUs2IGvWvjH/Q=; b=Jsbp1mbuUrTvkcC4g8kwQBOQlh38ovlnPTmO1BW4JYPT4GNl5wPLQX/h9wwuA6gkBI iQRM6p/By8D0cSAyrRYW8o3z/umh4J8T/cMc868BZRfrX4i2CwKx4M6YZ/8LQq+6XAgA evP7PQAvSxzVByuxz2NahESaHERP3uy91DxhcsLkcTzSF1JAzEtNIuqHtGprhnSCZWG7 PlnZfPHnUjCeF4WWOoROx4fwrdi1XxhugelBYdRPw5tiUC7ZNfzqV1k/pRP04g9QT4cd EikNvG5oURkmps2AZQ+D9X2+giTSzM8pFzKJZ5qx+dCFW5AIvh28H0lL76TFqgtA4bHW n0pg== X-Forwarded-Encrypted: i=1; AHgh+RpoqbgoSulbbuwBv1wHqxuG1Ck6fbJfDf8KFhWoENwXlY1srLGL06HbUt++baUcxV6dfRAlmKNE+mEAB4s=@vger.kernel.org X-Gm-Message-State: AOJu0YzKoNj84kVMsn1JToagr3ewE96m0A7LDUmNQj+wDj5/VAktaWd0 jFLvAJkqcg/VMDD/0LMVq/S9Frjbk9CVVzbzWB5RUvj/nAvSVHFryvOxlOBjsS1zaxs= X-Gm-Gg: AfdE7cnLdDQvAIRDeR+tx2FO/mkTD+9g/ol9tET6nQqsLseOSraXAMvtMUDyahbVGPm /9n3CJO6RiS2gSZAONP7zJo3/rEEPE++5BxSc3w9TgC4+SlMtE1qNX/eBGMzmDevgshlzv/8SWu PnTGUVJpK5h3Hqo79weDh1Hw0NgwK3EN5II9VhT+jiOF4UyH1vRY59hlOL0bxF6F8vzvquRLfex fAB9xZNPZJXmFm8cmDrFehPci/qZKnJi3qB7GZnVHbTMm6PiexY6wAXK1a4WjeXFPh19VSDZNXA uLGC3vtHATCwHjcfsT6GVwEH9zMxMrsxolSwkIgT39TZ3eAy9n6qEEGvqVTgxri8Pdgk+tWhZgv Z8UmdO5u58zxQG6Mf/6HWWaHi4KM7FUp3wT73SxiMvNI+VPysPtMPst3EmOVrks3NGOkvB/E9Qh /Mqbm4ePdLOtcBS+b/vsfAod42HVQn73ew/2kQTnzfgf/Jb7dy8mC/9boM0piCDy8= X-Received: by 2002:a17:902:cf0b:b0:2c8:4c29:afeb with SMTP id d9443c01a7336-2ca2d57ec77mr32392705ad.8.1782835586648; Tue, 30 Jun 2026 09:06:26 -0700 (PDT) Received: from mail-dy1-f175.google.com (mail-dy1-f175.google.com. [74.125.82.175]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ca382bb30dsm17116245ad.68.2026.06.30.09.06.26 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 Jun 2026 09:06:26 -0700 (PDT) Received: by mail-dy1-f175.google.com with SMTP id 5a478bee46e88-30bf8b2bd20so9125415eec.0 for ; Tue, 30 Jun 2026 09:06:26 -0700 (PDT) X-Forwarded-Encrypted: i=1; AHgh+RqzwVwvQCy0Yw+dValYSDt8bG2E4sFNtjxPvc1oS26efSgIkNEO5mXeiP8kvuzprI6gvXRJOqW+b0Z2ymg=@vger.kernel.org X-Received: by 2002:a05:6102:598c:b0:738:9dd5:9b03 with SMTP id ada2fe7eead31-73a38838db6mr1792608137.20.1782835280090; Tue, 30 Jun 2026 09:01:20 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20260629135917.1308621-1-arnd@kernel.org> In-Reply-To: From: Geert Uytterhoeven Date: Tue, 30 Jun 2026 18:01:07 +0200 X-Gmail-Original-Message-ID: X-Gm-Features: AVVi8Cc-rLKbwzFvmIKs2_rpHMNLxVULzvudUQINxHMw-KOr8IArAqRSnLCM1D8 Message-ID: Subject: Re: [PATCH] [RFC] gpiolib: introduce gpio_name() helper To: Arnd Bergmann Cc: Arnd Bergmann , Linus Walleij , Bartosz Golaszewski , Marcel Holtmann , MyungJoo Ham , Chanwoo Choi , Geert Uytterhoeven , Andy Shevchenko , Dmitry Torokhov , Ulf Hansson , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, "open list:GPIO SUBSYSTEM" , dri-devel@lists.freedesktop.org, linux-i2c@vger.kernel.org, linux-iio@vger.kernel.org, linux-input@vger.kernel.org, "linux-mmc @ vger . kernel . org" , linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-usb@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Hi Arnd, On Mon, 29 Jun 2026 at 19:54, Arnd Bergmann wrote: > On Mon, Jun 29, 2026, at 17:29, Geert Uytterhoeven wrote: > > On Mon, 29 Jun 2026 at 15:59, Arnd Bergmann wrote: > >> From: Arnd Bergmann > >> > >> Most remaining users of desc_to_gpio() only call it for printing debug > >> information. > >> > >> Replace this with a new gpiod_name() helper that returns the > >> gpio_desc->name string after checking the gpio_desc pointer. > >> > >> Signed-off-by: Arnd Bergmann > >> --- a/drivers/gpio/gpio-aggregator.c > >> +++ b/drivers/gpio/gpio-aggregator.c > >> @@ -758,8 +758,8 @@ int gpiochip_fwd_desc_add(struct gpiochip_fwd *fwd, struct gpio_desc *desc, > >> > >> fwd->descs[offset] = desc; > >> > >> - dev_dbg(chip->parent, "%u => gpio %d irq %d\n", offset, > >> - desc_to_gpio(desc), gpiod_to_irq(desc)); > >> + dev_dbg(chip->parent, "%u => gpio %s irq %d\n", offset, > >> + gpiod_name(desc), gpiod_to_irq(desc)); > >> > >> return 0; > >> } > > > > Before, this printed: > > > > gpio-aggregator gpio-aggregator.1: 0 => gpio 589 irq 188 > > gpio-aggregator gpio-aggregator.1: 1 => gpio 590 irq 189 > > > > After, this prints: > > > > gpio-aggregator gpio-aggregator.1: 0 => gpio (null) irq 188 > > gpio-aggregator gpio-aggregator.1: 1 => gpio (null) irq 189 > > > > Same results for instantiation using sysfs or configfs[1], although > > the latter does have optional support for specifying the name. > > I wonder how many of the other instances have the same problem > then. Would it be appropriate for gpiochip_fwd_desc_add() to set > a name itself to address this one? I don't think it would be appropriate for the GPIO aggregator to set that name. What we want to print here (for debugging) is the physical GPIO that an aggregator's GPIO is mapped to, not some consumer or line name (which is not guaranteed to be unique). E.g. "." would be fine. As gpiod_name() can only return a fixed string or an existing string, it can't return such a formatted string, though. And consumers don't have access to chip info? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds