diff options
author | Patrick Delaunay <patrick.delaunay@st.com> | 2019-03-07 09:57:14 +0100 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2019-04-11 20:10:05 -0600 |
commit | 662a74a2506c9a0d7a68de72158b45840c799174 (patch) | |
tree | d9eecc1f04ff65ba0fb91e543b604f30c3053a2e /drivers | |
parent | a442e61e245824f2cf7d7cf43844ac90e5d7e7a4 (diff) | |
download | u-boot-662a74a2506c9a0d7a68de72158b45840c799174.tar.gz |
sysreset: use syscon_regmap_lookup_by_phandle
Use the new function syscon_regmap_lookup_by_phandle()
to simplify the code.
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/sysreset/sysreset_syscon.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/sysreset/sysreset_syscon.c b/drivers/sysreset/sysreset_syscon.c index 34506402ac..3fb39b9952 100644 --- a/drivers/sysreset/sysreset_syscon.c +++ b/drivers/sysreset/sysreset_syscon.c @@ -36,20 +36,9 @@ static struct sysreset_ops syscon_reboot_ops = { int syscon_reboot_probe(struct udevice *dev) { struct syscon_reboot_priv *priv = dev_get_priv(dev); - int err; - u32 phandle; - ofnode node; - err = ofnode_read_u32(dev_ofnode(dev), "regmap", &phandle); - if (err) - return err; - - node = ofnode_get_by_phandle(phandle); - if (!ofnode_valid(node)) - return -EINVAL; - - priv->regmap = syscon_node_to_regmap(node); - if (!priv->regmap) { + priv->regmap = syscon_regmap_lookup_by_phandle(dev, "regmap"); + if (IS_ERR(priv->regmap)) { pr_err("unable to find regmap\n"); return -ENODEV; } |