From patchwork Thu Mar 23 19:46:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 9641853 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B6EF2602D6 for ; Thu, 23 Mar 2017 19:46:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5D542833B for ; Thu, 23 Mar 2017 19:46:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 981EF2846A; Thu, 23 Mar 2017 19:46:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1749B2833B for ; Thu, 23 Mar 2017 19:46:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751660AbdCWTqZ (ORCPT ); Thu, 23 Mar 2017 15:46:25 -0400 Received: from mga04.intel.com ([192.55.52.120]:44442 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751309AbdCWTqY (ORCPT ); Thu, 23 Mar 2017 15:46:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490298384; x=1521834384; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=bIBRprYIPOLseuOQeqF8jwdP3/UMXoVtQ/G+djdQbGA=; b=dy4ejNoKWYjgrqcNkyW8vA395WiuL7/0auXGsOc5OcyEwAo57GZVsX25 EbG64xObgOAJAESW7pz+O+kHpzZ7+g==; Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Mar 2017 12:46:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,211,1486454400"; d="scan'208";a="1126352968" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 23 Mar 2017 12:46:20 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 79D1D1E8; Thu, 23 Mar 2017 21:46:19 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Alexandre Courbot , linux-gpio@vger.kernel.org, Dmitry Torokhov , Hans de Goede , linux-kernel@vger.kernel.org, Mika Westerberg , Jarkko Nikula , linux-acpi@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v1 2/8] gpio: acpi: Align acpi_find_gpio() with DT version Date: Thu, 23 Mar 2017 21:46:12 +0200 Message-Id: <20170323194618.26548-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170323194618.26548-1-andriy.shevchenko@linux.intel.com> References: <20170323194618.26548-1-andriy.shevchenko@linux.intel.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP By some reason acpi_find_gpio() and acpi_gpio_count() have compared connection ID to "gpios" when tries to check if suffix is needed or not. Don't do any assumptions about what connection ID can be and, when defined, use it only with suffix as it's done in the device tree version. Signed-off-by: Andy Shevchenko Reviewed-by: Dmitry Torokhov --- drivers/gpio/gpiolib-acpi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c index 56a6b1be3a17..3bda3166d418 100644 --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c @@ -593,7 +593,7 @@ struct gpio_desc *acpi_find_gpio(struct device *dev, /* Try first from _DSD */ for (i = 0; i < ARRAY_SIZE(gpio_suffixes); i++) { - if (con_id && strcmp(con_id, "gpios")) { + if (con_id) { snprintf(propname, sizeof(propname), "%s-%s", con_id, gpio_suffixes[i]); } else { @@ -1081,7 +1081,7 @@ int acpi_gpio_count(struct device *dev, const char *con_id) /* Try first from _DSD */ for (i = 0; i < ARRAY_SIZE(gpio_suffixes); i++) { - if (con_id && strcmp(con_id, "gpios")) + if (con_id) snprintf(propname, sizeof(propname), "%s-%s", con_id, gpio_suffixes[i]); else