diff options
author | Patrick Delaunay <patrick.delaunay@st.com> | 2018-07-09 14:59:29 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-07-20 15:55:04 -0400 |
commit | 1f6ca3f42f6edf143473159297f4c515b1cf36f6 (patch) | |
tree | a8f69b7cf75e437ee288784b4fc1bdafbe04eddf /drivers/sysreset | |
parent | af95a3e7c03e1538f43ca843f7282f36ce0488b8 (diff) |
sysreset: syscon: update regmap access to syscon
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>
Diffstat (limited to 'drivers/sysreset')
-rw-r--r-- | drivers/sysreset/sysreset_syscon.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/sysreset/sysreset_syscon.c b/drivers/sysreset/sysreset_syscon.c index f19e80e6e4..34506402ac 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; |