From patchwork Thu Jul 13 10:47:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Chen X-Patchwork-Id: 702406 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DEFA5EB64DD for ; Thu, 13 Jul 2023 10:47:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232887AbjGMKrr (ORCPT ); Thu, 13 Jul 2023 06:47:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232877AbjGMKrq (ORCPT ); Thu, 13 Jul 2023 06:47:46 -0400 Received: from sender4-op-o15.zoho.com (sender4-op-o15.zoho.com [136.143.188.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0C6B212B; Thu, 13 Jul 2023 03:47:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689245257; cv=none; d=zohomail.com; s=zohoarc; b=QPM9I1dPces+vEz188Jld78QmEaoaP5YWZ+07xq+2lMpzEnBybfQaByEzg+ZfJq1Usl0x6/xNfVMlvGFahFreHfuFsZTxDrrGomXwgULUFyhpXpV4a39DarUCmnKo/IRGzcpbyBQKxArnL8YmNXLMQJ1vpFjWwxu6Zk74cooz5A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689245257; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=sUb+XBeJjVlNbYVY/GHuUMJPh6CEvtIvrz26lQkXa7o=; b=V03yhIePcddoOLoToHekeeE1333uaqGJnS1GaLwoUU4maQoxuwO/gsT6g/X5saYNiU8VVAKAm5xErc4aHcANeSH2ldnq7xs7hb7GraxlMJfzOb6hB6KsmWNmx7nFvuiOO3eQ6n+2EKBNs1tzSyykKTaER7tVxPdcVdZWnRFaQ3c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=linux.beauty; spf=pass smtp.mailfrom=me@linux.beauty; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1689245257; s=zmail; d=linux.beauty; i=me@linux.beauty; h=Date:Date:From:From:To:To:Message-ID:In-Reply-To:References:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To:Cc; bh=sUb+XBeJjVlNbYVY/GHuUMJPh6CEvtIvrz26lQkXa7o=; b=HoFGWSDRfHjdG8MrDfzHIB9vva7qf6RmYUdnpCUQw4JF8IrGIAOt/aW5KlKm23H6 2swOjDaOXH7loBscAxFXV0JGC7LthzZMJP7GUlmdfvhdNoB5+bwB6rvXsDv5ibaJ9zM sDYieBbtxJI8wk9owmkTxVbEOLP0VZnCC0R9cgQ8= Received: from mail.zoho.com by mx.zohomail.com with SMTP id 1689245255684909.136685335917; Thu, 13 Jul 2023 03:47:35 -0700 (PDT) Date: Thu, 13 Jul 2023 18:47:35 +0800 From: Li Chen To: "Rob Herring" , "Frank Rowand" , "devicetree" , "linux-kernel" Message-ID: <1894edd07ee.b7245352142935.3234373322799059936@linux.beauty> In-Reply-To: <1894ed7a1a9.f5e49d5d141371.2744760538860302017@linux.beauty> References: <1894ed7a1a9.f5e49d5d141371.2744760538860302017@linux.beauty> Subject: [PATCH V2] of: property: fw_devlink: fixup return value check of strcmp_suffix in parse_gpios MIME-Version: 1.0 Importance: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This commit addresses an issue where enabling fw_devlink=on was causing a PCIe malfunction, resulting in endpoints missing. After thorough investigation, it was determined that the root cause was an incorrect usage of strcmp_suffix in parse_gpios. Fixes: d473d32c2fba ("of: property: fw_devlink: do not link ".*,nr-gpios"") Signed-off-by: Li Chen Cc: stable@vger.kernel.org --- changes: v1->v2: add Cc stable drivers/of/property.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/of/property.c b/drivers/of/property.c index ddc75cd50825..261eb8f3be08 100644 --- a/drivers/of/property.c +++ b/drivers/of/property.c @@ -1272,7 +1272,7 @@ DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells") static struct device_node *parse_gpios(struct device_node *np, const char *prop_name, int index) { - if (!strcmp_suffix(prop_name, ",nr-gpios")) + if (strcmp_suffix(prop_name, ",nr-gpios")) return NULL; return parse_suffix_prop_cells(np, prop_name, index, "-gpios",