Received: by 10.192.165.156 with SMTP id m28csp71345imm; Tue, 10 Apr 2018 16:39:58 -0700 (PDT) X-Google-Smtp-Source: AIpwx497ETUMWQN0myl1ApB4RSeEgNknpXiu73rh8/oJ4FdrZqPmO+uGgfoieAQ7iGRqZ9QGKi3U X-Received: by 2002:a17:902:bc3:: with SMTP id 61-v6mr1238005plr.117.1523403598269; Tue, 10 Apr 2018 16:39:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523403598; cv=none; d=google.com; s=arc-20160816; b=YMRfdx59zL5+IpPknm9Ijpun7ieGoMlaky1k4e+fc5cFVLbuUYyMfhOxE8jm4V5oxm 2PIJNE5L5OjyFPvWj7q6JSCRqTHRZZvYAVSS3Vr5Cg8LzfmN6D/8nFleXMQx0Z1Fcpxm bY0E3VU2+eUzbJltdGzx+tTaetb+QM6JjuBwDijqTupYbylWXFQGwXmpgFJsgRC917xQ R8GdCDuCyjiyY51D9r5SQi+wFHQRD4DNNq6lcgUeHBZR4G7NuHCBL0nQn10NgBKZLG63 RLWL/dzzDYOaChpV7cId+qnQcQ05qMkWP3qq3jYsvw4LpZJ747zCks6LwMTe8eU+q919 MPXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=QO21qBVR0J4Iire2m02EcKffWAQ8FhVsxszoXfXf3ew=; b=WaaTq/alQijylotRFpz04xaWkEG/IYTxmWK57/axywEmnBkFoQF4S85qziNIGGkg4F QJd3lP0gtl/J9IZbWGElasjUQJnDzm2PZvrX9XEhD+KMEYdSUXor10caWt/1E6+ueEGS qAFGTfqHjaw3EBamhBgkFj9quQOrSzhLmDaZjY5V1kqy2IGZRlZBpTdukPj6TC6NmBDn 3Rnbwf2zVwzgri4CiNgstlLaedNQp32Jr5Z92Z6Io+IklSc1uWQAnrpnA3YBvRdcLM00 NwW+PuzNUF/cjE464X4ILShgN6VIrxjZO6aaNiucFZiRgHPB++r4jW0Gn+HjSTn3MCc/ /2hw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7-v6si3661370plk.397.2018.04.10.16.39.21; Tue, 10 Apr 2018 16:39:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754699AbeDJXfL (ORCPT + 99 others); Tue, 10 Apr 2018 19:35:11 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:38094 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753843AbeDJW1x (ORCPT ); Tue, 10 Apr 2018 18:27:53 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E4EDFCDA; Tue, 10 Apr 2018 22:27:52 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Reported-by: Jason Kridner" , Linus Walleij , Sasha Levin Subject: [PATCH 4.15 048/168] gpio: label descriptors using the device name Date: Wed, 11 Apr 2018 00:23:10 +0200 Message-Id: <20180410212802.246691765@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212800.144079021@linuxfoundation.org> References: <20180410212800.144079021@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Linus Walleij [ Upstream commit 24e78079bf2250874e33da2e7cfbb6db72d3caf4 ] Some GPIO lines appear named "?" in the lsgpio dump due to their requesting drivers not passing a reasonable label. Most typically this happens if a device tree node just defines gpios = <...> and not foo-gpios = <...>, the former gets named "foo" and the latter gets named "?". However the struct device passed in is always valid so let's just label the GPIO with dev_name() on the device if no proper label was passed. Cc: Reported-by: Jason Kridner Reported-by: Jason Kridner Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/gpio/gpiolib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -3647,7 +3647,8 @@ struct gpio_desc *__must_check gpiod_get return desc; } - status = gpiod_request(desc, con_id); + /* If a connection label was passed use that, else use the device name as label */ + status = gpiod_request(desc, con_id ? con_id : dev_name(dev)); if (status < 0) return ERR_PTR(status);