From: Patrick Delaunay <patrick.delaunay@st.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] sysreset: syscon: update regmap access to syscon
Date: Mon, 9 Jul 2018 14:59:29 +0200 [thread overview]
Message-ID: <1531141169-6987-1-git-send-email-patrick.delaunay@st.com> (raw)
Use new API syscon_node_to_regmap in sysreset_syscon driver
for compatible "syscon-reboot"; that's avoid the need of explicit
syscon binding for "regmap" handle.
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
---
drivers/sysreset/sysreset_syscon.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/sysreset/sysreset_syscon.c b/drivers/sysreset/sysreset_syscon.c
index f19e80e..3450640 100644
--- a/drivers/sysreset/sysreset_syscon.c
+++ b/drivers/sysreset/sysreset_syscon.c
@@ -35,18 +35,20 @@ static struct sysreset_ops syscon_reboot_ops = {
int syscon_reboot_probe(struct udevice *dev)
{
- struct udevice *syscon;
struct syscon_reboot_priv *priv = dev_get_priv(dev);
int err;
+ u32 phandle;
+ ofnode node;
- err = uclass_get_device_by_phandle(UCLASS_SYSCON, dev,
- "regmap", &syscon);
- if (err) {
- pr_err("unable to find syscon device\n");
+ err = ofnode_read_u32(dev_ofnode(dev), "regmap", &phandle);
+ if (err)
return err;
- }
- priv->regmap = syscon_get_regmap(syscon);
+ node = ofnode_get_by_phandle(phandle);
+ if (!ofnode_valid(node))
+ return -EINVAL;
+
+ priv->regmap = syscon_node_to_regmap(node);
if (!priv->regmap) {
pr_err("unable to find regmap\n");
return -ENODEV;
--
2.7.4
next reply other threads:[~2018-07-09 12:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-09 12:59 Patrick Delaunay [this message]
2018-07-10 20:49 ` [U-Boot] [PATCH] sysreset: syscon: update regmap access to syscon Simon Glass
2018-07-16 8:19 ` Patrick DELAUNAY
2018-07-20 22:34 ` [U-Boot] " Tom Rini
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=1531141169-6987-1-git-send-email-patrick.delaunay@st.com \
--to=patrick.delaunay@st.com \
--cc=u-boot@lists.denx.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.