Received: by 10.192.165.156 with SMTP id m28csp1121788imm; Wed, 11 Apr 2018 12:51:32 -0700 (PDT) X-Google-Smtp-Source: AIpwx496HaCC2/lWMVy+ekuZw+MqKnGdEofk4AVr8D5qJwV0KpqgUA+i+GWqg6hB12WqrRv7Zal5 X-Received: by 2002:a17:902:8505:: with SMTP id bj5-v6mr6320734plb.231.1523476292853; Wed, 11 Apr 2018 12:51:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523476292; cv=none; d=google.com; s=arc-20160816; b=DONP+W7A1i3YBSh5jN6FYki5HtAkgZwxcP09rysq7YdqHCtt8T7aChlJg72NtHIrfZ R2jkSthVlm5j23JoeyrchPUwRxHjiRO6/TW4RT6s2nYLAbCWlipLxhkF5dkJ8FRsmepd Ueih7FYk/yfZ6rcS5eBZgf9YVvNZlE8Q1P4Gbojitg80Tv4sqLQ9cwnZ2afPUsjAjwkw oiGEmytEKGchzAN5LGTO7fE6VWYuzpV2ZNbQ3QR2i6hXBhlqgXUbmBeMQXMUoRw+/6l6 HQM/5tpl5+exS1sP1ayci0BA+E9O108LAy4Y9eKvUmlnNQk4f2xmLf+qD6cnoPe4SihP 0FQg== 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=MpoUnfB9lgdorNjtuWU5877LrI6nmRf5h3uftAbrwTk=; b=sROnBOpUGeBwbZfrDTs6m6l4KSg8kZI1nhH6N/BagDlt63U/WV+FUyEUoQ3hZUmd+v sO0lejxYriPAToAewOiObSI1Vf4MJcXF0dvbo4Ui29nJAWfvG+a5sfHrZTVP9iAIl0F/ wKqdNw23kbccJopbIIIyVHJyjr/QRa9pSUyUzb1PHmbAaxqHZ2VXx2q+455EtEk3JHrw EteANxCnVPWvWjc3qZNs2YB6LFmOIATBq5BIBglMSIRMxS2X0wRYTdZUtpv7KAcuu18j GcdCOKbASpCxUBdgz46nWHFDyzUmV8wwjBMbv/zKDNAwLPfQ/MxUE3TXDKkBfZto/6kV Hc2Q== 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 f26si1265945pfn.269.2018.04.11.12.50.56; Wed, 11 Apr 2018 12:51:32 -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 S934072AbeDKS7R (ORCPT + 99 others); Wed, 11 Apr 2018 14:59:17 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:37296 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934024AbeDKS7P (ORCPT ); Wed, 11 Apr 2018 14:59:15 -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 60CE4D0A; Wed, 11 Apr 2018 18:59:14 +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.9 140/310] gpio: label descriptors using the device name Date: Wed, 11 Apr 2018 20:34:39 +0200 Message-Id: <20180411183628.475928545@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183622.305902791@linuxfoundation.org> References: <20180411183622.305902791@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.9-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 @@ -3231,7 +3231,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);