Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3531467pxu; Tue, 15 Dec 2020 09:06:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJzuMGSI3inHNOKdyvRPsZ1eaC03CAABO/hHUbTmMgOG4AyX+DlYHN415EaIyI2aw2hcykWj X-Received: by 2002:aa7:c355:: with SMTP id j21mr29637612edr.338.1608051977145; Tue, 15 Dec 2020 09:06:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608051977; cv=none; d=google.com; s=arc-20160816; b=jRVkjOlxrqx6NwPSnpkrsir6NqxO3tsA2Ol/SsF1idbTJ6QG926uYvR2Z6BCw8K8b+ zgynJ/kDdvPVQ30ourAuS5AgeowIQFwc/UO2OxskdoGYfz2ZH8OsuFzEGPRKmreJy1ST mmafV9lQScPNVo1eIolAaHqgOu5Gka09p+KNpyi5oCg0s317Q8pXkPWJBSI1jrYAI36u aHBgsF4Q4fALD30WDikpGaWIEqGTMA+jlOiMWqQa1H2Ptw9qfjveEy8Uv27Vwp+ak27C gz/ZCxI3KlNBY1l74SQ6bBsShKIYypE9WflSOAyfHAbaTAHsJbsbwtH88TssqP3MKCjy YpRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=xxFeUjonFw77THjceoCtcx/rMZ97apnNhN3IhCP1UQI=; b=JNUFVLdy7LBp8JhI1flj9sEUAXlvWwqXQeFRX1jSKAG1XKSJCEqku+CuEhTlNE/M2o NL2hLLJl8VQFIG3SzZwzkBZ9MGaJIQPUMgGjhrtJI0R28xcfxNWm3A+WOGN92Fn2Kv0g jRshfrAEprqiw55lywZpIpy+G7J+/SrdLpCjI8jSQmcKhTdFZzpTbL5ARn+9HSconS/7 aNhM7ThzVXe46jBqsgGDZqtI1aaHYNqf3CDdc25KaPY+qWZAbOFMzCwGMlLj1Zvthm0V ZusdQSPnBU27gsVSicag84eKI5eCqilwZp8knIHL6LwhxS/cvOFlZEFOH/9tVfXX8sT4 +56g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aue75vfY; 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 y15si326672edv.392.2020.12.15.09.05.53; Tue, 15 Dec 2020 09:06:17 -0800 (PST) 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=aue75vfY; 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 S1730392AbgLORD0 (ORCPT + 99 others); Tue, 15 Dec 2020 12:03:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730274AbgLORDA (ORCPT ); Tue, 15 Dec 2020 12:03:00 -0500 Received: from mail-oi1-x244.google.com (mail-oi1-x244.google.com [IPv6:2607:f8b0:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BF87C0617B0 for ; Tue, 15 Dec 2020 09:02:20 -0800 (PST) Received: by mail-oi1-x244.google.com with SMTP id p126so24062784oif.7 for ; Tue, 15 Dec 2020 09:02:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xxFeUjonFw77THjceoCtcx/rMZ97apnNhN3IhCP1UQI=; b=aue75vfYUzY/GfGESi3vMLtB76kOfdkcAR4gi8MefVNWtK2XuHIhcA7QGhMSo7HOVQ ozgUxbh8LnJONkVBu25itSz8lO7J6r6UVRi4CXL1BmrgG4rNv2C0kX3eu9wBqc58/5gD MvlXH1cVJYPxYNeX4QImasF/53U1iXEnCnLFfPz6UF2ZjmE527Un+/Osa/X5MciaBSz1 3rUCgkIwIVrm6Ug2YtAvqSTZyUnMJJEwj6IVGaDqur/hRgcBrOASovJzHFOZxnHXKKMC yX1PIZ3IJOxIkTMv3nHxkxAzlBpIHYYSN1OIVG7akvXKpsTUhDGOQxFqBFIIpMqghThC IBAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xxFeUjonFw77THjceoCtcx/rMZ97apnNhN3IhCP1UQI=; b=J502tjR57eL1SlQvpoJkl6K7PHeOtpn0WLySEtpg/ZoGwL12ne8BnKfhkXUx6cEUUE W1q0PgGOWzOh0B6cKlpBuUNSDANOSPKhPHZfTqRp4m2L08Skf+ymDec8u//bG6zvAbHg N6Q/prtWKkX/OVW7KUNW/+XQXwO4Z1C1VDEMv8+YvizF0mXYrvyThpAcoZDLUfJlf5SW Kc/8Y8NgCIX+V3/ha+qZUHy8he/Pkrgs0U31/+K8GZOlMST2xZye8Wu0pmMtqixOIi+L 4QH51ujRSUtywct7TrRTPfTBa6LGYajoufanx/9dxthQXzrYJQPmXlHZDG6MKLSkTenZ u97A== X-Gm-Message-State: AOAM530zL9pDbopYP6Zn2615Mcew8M3izBjFC24ZlJ9Y6I1Rq5f371RJ 1/LFTK1fMOkXufyTuGMN5sAxUg== X-Received: by 2002:aca:4c4f:: with SMTP id z76mr22331736oia.1.1608051739520; Tue, 15 Dec 2020 09:02:19 -0800 (PST) Received: from localhost.localdomain (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id s139sm5152887oih.10.2020.12.15.09.02.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Dec 2020 09:02:18 -0800 (PST) From: Bjorn Andersson To: Linus Walleij , Bartosz Golaszewski Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH] gpiolib: Allow name duplicates of "" and "NC" Date: Tue, 15 Dec 2020 09:03:08 -0800 Message-Id: <20201215170308.2037624-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Not all GPIO pins are exposed to the world and this is typically described by not giving these lines particular names, commonly "" or "NC". With the recent introduction of '2cd64ae98f35 ("gpiolib: Disallow identical line names in the same chip")' any gpiochip with multiple such pins will refuse to probe. Fix this by treating "" and "NC" as "no name specified" in gpio_name_to_desc() Fixes: 2cd64ae98f35 ("gpiolib: Disallow identical line names in the same chip") Signed-off-by: Bjorn Andersson --- The introduction of 2cd64ae98f35 breaks pretty much all Qualcomm boards and grepping the DT tree indicates that other vendors will have the same problem. In addition to this the am335x-* boards will also needs "[NC]", "[ethernet]", "[emmc"], "[i2c0]", "[SYSBOOT]" and "[JTAG]" added to this list to allow booting v5.11 with the past and present dtb/dts files. drivers/gpio/gpiolib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index b3340ba68471..407ba79ae571 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -302,7 +302,7 @@ static struct gpio_desc *gpio_name_to_desc(const char * const name) struct gpio_device *gdev; unsigned long flags; - if (!name) + if (!name || !strcmp(name, "") || !strcmp(name, "NC")) return NULL; spin_lock_irqsave(&gpio_lock, flags); -- 2.29.2