public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Lee Jones <lee@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	Chen-Yu Tsai <wens@kernel.org>, Rob Herring <robh@kernel.org>,
	Peter Griffin <peter.griffin@linaro.org>,
	linaro-s32@linaro.org, NXP S32 Linux Team <s32@nxp.com>
Subject: [PATCH v2] mfd: syscon: return -EPROBE_DEFER if the syscon is not found
Date: Sun, 2 Nov 2025 14:59:22 +0300	[thread overview]
Message-ID: <aQdHmrchkmOr34r3@stanley.mountain> (raw)

These days we can register syscons with of_syscon_register_regmap() so
when we can't find the syscon that probably means it hasn't been
registered yet.  Return -EPROBE_DEFER so the driver will try probing
again.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Chen-Yu Tsai <wens@kernel.org>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
---
v2: In v1, I added a property to the syscon yaml file, but those changes
    were not welcomed or required.  The "syscon" compatible means "have
    Linux create a regmap for me" and my property meant the opposite
    so it was kind of pointless.  So don't do that.

    Link to v1.
    https://lore.kernel.org/all/cover.1761753288.git.dan.carpenter@linaro.org/

 drivers/mfd/syscon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
index ae71a2710bed..e5d5def594f6 100644
--- a/drivers/mfd/syscon.c
+++ b/drivers/mfd/syscon.c
@@ -183,7 +183,7 @@ static struct regmap *device_node_get_regmap(struct device_node *np,
 		if (create_regmap)
 			syscon = of_syscon_register(np, check_res);
 		else
-			syscon = ERR_PTR(-EINVAL);
+			syscon = ERR_PTR(-EPROBE_DEFER);
 	}
 	mutex_unlock(&syscon_list_lock);
 
-- 
2.51.0


             reply	other threads:[~2025-11-02 11:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-02 11:59 Dan Carpenter [this message]
2025-11-13 14:32 ` (subset) [PATCH v2] mfd: syscon: return -EPROBE_DEFER if the syscon is not found 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=aQdHmrchkmOr34r3@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=arnd@arndb.de \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lee@kernel.org \
    --cc=linaro-s32@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.griffin@linaro.org \
    --cc=robh@kernel.org \
    --cc=s32@nxp.com \
    --cc=wens@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