mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-27 15:10:26 +09:00
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>
This commit is contained in:
parent
a442e61e24
commit
662a74a250
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user