From: Icenowy Zheng <icenowy@aosc.io>
To: Lee Jones <lee.jones@linaro.org>
Cc: linux-kernel@vger.kernel.org, Icenowy Zheng <icenowy@aosc.io>
Subject: [PATCH] mfd: core: Fix handle of OF disabled MFD cells
Date: Sat, 1 Aug 2020 15:01:30 +0800 [thread overview]
Message-ID: <20200801070130.3323112-1-icenowy@aosc.io> (raw)
When rewriting the OF match code of MFD core, addition of cells disabled
in OF will result in a failure with error -ENODEV. This is an unexpected
behavior, as the previous behavior is silently ignore the cell. On
SBCs with AXP20x PMICs, this leads to boot failure if AXP20x PMIC
support is built-in and some cells (especially power supply ones) are
disabled.
Silently ignore the cell when -ENODEV occurs.
Fixes: e49aa9a9bd22 ("mfd: core: Make a best effort attempt to match devices with the correct of_nodes")
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
drivers/mfd/mfd-core.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index c3ef58a802bee..31b363c64f4b4 100644
--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -215,8 +215,13 @@ static int mfd_add_device(struct device *parent, int id,
ret = mfd_match_of_node_to_dev(pdev, np, cell);
if (ret == -EAGAIN)
continue;
- if (ret)
+ if (ret) {
+ if (ret == -ENODEV) {
+ /* Ignore disabled devices error free */
+ ret = 0;
+ }
goto fail_alias;
+ }
break;
}
--
2.27.0
next reply other threads:[~2020-08-01 7:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-01 7:01 Icenowy Zheng [this message]
2020-08-19 8:11 ` [PATCH] mfd: core: Fix handle of OF disabled MFD cells Lee Jones
2020-08-19 8:16 ` Icenowy Zheng
2020-08-19 8:26 ` Lee Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200801070130.3323112-1-icenowy@aosc.io \
--to=icenowy@aosc.io \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).