Message ID | 20230809132757.2470544-24-herve.codina@bootlin.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2892090vqr; Wed, 9 Aug 2023 08:55:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHQ9k6hrQE62fxxbF2KjDSSqnGyAbVjTfWvZ2TJFVn80Si8hndR6DgzjXuI+k4ylRQWyBL7 X-Received: by 2002:a05:6512:15aa:b0:4fb:fe97:5e35 with SMTP id bp42-20020a05651215aa00b004fbfe975e35mr2666098lfb.47.1691596552176; Wed, 09 Aug 2023 08:55:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691596552; cv=none; d=google.com; s=arc-20160816; b=hRE+FmlqcIjSWjiRIRKrZ7PyrJTvf2IL5ZRKlurYtkRrsh4bpxkvXI1GgIUiFdzvgV mLaRbf5YefR3TD3hIboGis/HaNuBfQdEog4QmoewhrzkK6tZsjyn4SHluzUPFFl6vNeZ veU8F0s3uZ3GDN/XtoOvyWhZswR+IhHTnElRVyt3pk4vq0eNImKgMpfhQTIjJMmh7VWu /VTSm1i9LTphSB7wg/kNnQUx8wraF1d+ElNOdap0v8Dz1PM2sSIpejUiz6+aZYpnnLYL 8zN+s4u20vqbWlgN8jIYi7xrWqVpo9iEbeQTRVG/bwpCPPBdoYkdkpIRiogVJXkNYnPX YKAA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=VR4cnx2N+04eGgRYyGyebcaIM9EByQCnUdS4tT1vSe0=; fh=OtJVFpZ5Y8/ND7g8QcUIbRSFhG4LznwcYYtG4zWKevM=; b=mqWNiu0Ddw8AJ9XNzI7awmaTaaFDo5NaUIFu+ESNHc0ZEZRVTd6cEQj1oqZLItUbO3 TMAAyGy0Fo6zyTECDn6DBdSxdCNUI97XH0m3sPTEoRTRebh96n0Q4/W0O/Rm1zuQlRz5 CIl/XRhBkmNeCyhIGIfdHH5p5TCvYCGcH5oXPtS69gouyotEE6XCq9C4C5xg9B4fyLHT +VfLBO7fVRO/m/peooh91S4QaV2ybC0mrTakh6Bb3LYVf5citO9y0DKdpF3EW0xR2IVD 7X1C04fZkDMVFt3MGey6FnlrRftt3fLQhmHM7KNQyG2XJj1/ndpQbOdn1750UgXFwApz JTuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=RC4g+mdP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e14-20020a170906504e00b0099207b3bc46si9218768ejk.322.2023.08.09.08.55.13; Wed, 09 Aug 2023 08:55:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=RC4g+mdP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233314AbjHINa1 (ORCPT <rfc822;craechal@gmail.com> + 99 others); Wed, 9 Aug 2023 09:30:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233062AbjHIN3p (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 9 Aug 2023 09:29:45 -0400 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CECB3582; Wed, 9 Aug 2023 06:28:59 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPA id E6C1940007; Wed, 9 Aug 2023 13:28:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1691587735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VR4cnx2N+04eGgRYyGyebcaIM9EByQCnUdS4tT1vSe0=; b=RC4g+mdPwKb6I9+NrID8ap1PXtRoLXjK51YOO/bY38etqbMYcMXZEHtKJ4FzktDYNeuufD 9ZPui4xoieG+KeySFTgKvp1IP3jRzjChKDqeLOPDy6fwDDI3CSTbK1Jzz3wVz0WgXW8J5Q 9E59ipZqEcmB4aykrvOeNK+C+hfJIPUt3SxFbeOHIWzVj3jCgyZK7ryVYXEOQ3+FKXRV8k wMymgXZRYqJGY0YV0Li7FC2ZfOvHM22p7rDQTIxEwHZOghlXjnB82FxCU+AmI23F6qVFoZ U47XYUD1jeKssUCVUIavxK1k8G34L2UqMBHsHLfIDXKOENRT8bAb5Nz4jyt9xQ== From: Herve Codina <herve.codina@bootlin.com> To: Herve Codina <herve.codina@bootlin.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Andrew Lunn <andrew@lunn.ch>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Lee Jones <lee@kernel.org>, Linus Walleij <linus.walleij@linaro.org>, Qiang Zhao <qiang.zhao@nxp.com>, Li Yang <leoyang.li@nxp.com>, Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, Shengjiu Wang <shengjiu.wang@gmail.com>, Xiubo Li <Xiubo.Lee@gmail.com>, Fabio Estevam <festevam@gmail.com>, Nicolin Chen <nicoleotsuka@gmail.com>, Christophe Leroy <christophe.leroy@csgroup.eu>, Randy Dunlap <rdunlap@infradead.org> Cc: netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, alsa-devel@alsa-project.org, Thomas Petazzoni <thomas.petazzoni@bootlin.com> Subject: [PATCH v3 23/28] mfd: core: Ensure disabled devices are skiped without aborting Date: Wed, 9 Aug 2023 15:27:50 +0200 Message-ID: <20230809132757.2470544-24-herve.codina@bootlin.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230809132757.2470544-1-herve.codina@bootlin.com> References: <20230809132757.2470544-1-herve.codina@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773767545958657089 X-GMAIL-MSGID: 1773767545958657089 |
Series |
Add support for QMC HDLC, framer infrastruture and PEF2256 framer
|
|
Commit Message
Herve Codina
Aug. 9, 2023, 1:27 p.m. UTC
The loop searching for a matching device based on its compatible string is aborted when a matching disabled device is found. This abort prevents to add devices as soon as one disabled device is found. Continue searching for an other device instead of aborting on the first disabled one fixes the issue. Fixes: 22380b65dc70 ("mfd: mfd-core: Ensure disabled devices are ignored without error") Signed-off-by: Herve Codina <herve.codina@bootlin.com> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> --- drivers/mfd/mfd-core.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c index 0ed7c0d7784e..2b85509a90fc 100644 --- a/drivers/mfd/mfd-core.c +++ b/drivers/mfd/mfd-core.c @@ -146,6 +146,7 @@ static int mfd_add_device(struct device *parent, int id, struct platform_device *pdev; struct device_node *np = NULL; struct mfd_of_node_entry *of_entry, *tmp; + bool disabled = false; int ret = -ENOMEM; int platform_id; int r; @@ -183,11 +184,10 @@ static int mfd_add_device(struct device *parent, int id, if (IS_ENABLED(CONFIG_OF) && parent->of_node && cell->of_compatible) { for_each_child_of_node(parent->of_node, np) { if (of_device_is_compatible(np, cell->of_compatible)) { - /* Ignore 'disabled' devices error free */ + /* Skip 'disabled' devices */ if (!of_device_is_available(np)) { - of_node_put(np); - ret = 0; - goto fail_alias; + disabled = true; + continue; } ret = mfd_match_of_node_to_dev(pdev, np, cell); @@ -197,10 +197,17 @@ static int mfd_add_device(struct device *parent, int id, if (ret) goto fail_alias; - break; + goto match; } } + if (disabled) { + /* Ignore 'disabled' devices error free */ + ret = 0; + goto fail_alias; + } + +match: if (!pdev->dev.of_node) pr_warn("%s: Failed to locate of_node [id: %d]\n", cell->name, platform_id);