Received: by 10.192.165.156 with SMTP id m28csp48730imm; Tue, 10 Apr 2018 16:08:09 -0700 (PDT) X-Google-Smtp-Source: AIpwx48900dkOl0iot+uhbyKIeiCC+i1/VgNT7PcmjbOQc09+avPvHrE/0UX+GIbv2sbyo69uMDi X-Received: by 2002:a17:902:5a8d:: with SMTP id r13-v6mr2446230pli.394.1523401688799; Tue, 10 Apr 2018 16:08:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523401688; cv=none; d=google.com; s=arc-20160816; b=B1QTz9Spron88e1gHm3REvS8G3dgZ9I+FNQf/blL0QWu8b6oMW+NFzcOX4CLEb52pW rutkVT9qXR8XCk+ni/Q64nYcByK/eTKkqUGtUBjGkDYIKtxiXDEQ9AlCIaexl0Ss5X3c WnRCZs9MBqxqdgyw5GBGPTtNKUNWr3/CZc7LXpzn2Prg08Ww0Kve0FvT063q3NZTWb84 Agyq6YN5FUafaP5FltfuEqMV7VeSMAWDs0X+ATtbo0jFxi034AD9IGsdVmEyF3xcmc+G nN4lM1HAgESjS0r6xvo+1Wm3wqEQgCGhZjSRBr43i/MGjgF6/e7/89d8Q1WKhGHVjnQN 7YhQ== 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=w70aNLO0eX6w2qOuk9jaeU3pADNEdWjFZZi/pk1289A=; b=r/eHRUfQ3mBIGCBVLn8huqlbJ3R9U5uQOg78RXkFMPnXQe4rsjG8S8XZ2NeeAQmern SGYMq8oFp7HIpmzdu0Yk2yhcK/jV796X6UetWX722cJN0tixbX/TOGHqiqAKRnYHnxoo 0kkAkjY5jCeYTRG6bK/yytNV0/oYswpdYIcWkisug/GE59Twob4/bARltup0rSy8Q1wW sQxXjMFSJigxN9Fg6yvCfg9ksqqwsK7QKRbfUckJWUKq19BvRI4B4mmnD8p4neHuX451 Y/10yZ06mW2z8WheQuty8eMyPdKnspr5FqxRUQci59DwIMPHimbv5SwWSi49EnzVFyPY qR1g== 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 a25si2878544pfc.409.2018.04.10.16.07.32; Tue, 10 Apr 2018 16:08:08 -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 S1755495AbeDJWfM (ORCPT + 99 others); Tue, 10 Apr 2018 18:35:12 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:42004 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753443AbeDJWfK (ORCPT ); Tue, 10 Apr 2018 18:35:10 -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 A019CDBB; Tue, 10 Apr 2018 22:35:09 +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.14 036/138] gpio: label descriptors using the device name Date: Wed, 11 Apr 2018 00:23:46 +0200 Message-Id: <20180410212906.311484348@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212902.121524696@linuxfoundation.org> References: <20180410212902.121524696@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.14-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 @@ -3340,7 +3340,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);