mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-28 23:50:26 +09:00
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>
This commit is contained in:
parent
af95a3e7c0
commit
1f6ca3f42f
@ -35,18 +35,20 @@ static struct sysreset_ops syscon_reboot_ops = {
|
|||||||
|
|
||||||
int syscon_reboot_probe(struct udevice *dev)
|
int syscon_reboot_probe(struct udevice *dev)
|
||||||
{
|
{
|
||||||
struct udevice *syscon;
|
|
||||||
struct syscon_reboot_priv *priv = dev_get_priv(dev);
|
struct syscon_reboot_priv *priv = dev_get_priv(dev);
|
||||||
int err;
|
int err;
|
||||||
|
u32 phandle;
|
||||||
|
ofnode node;
|
||||||
|
|
||||||
err = uclass_get_device_by_phandle(UCLASS_SYSCON, dev,
|
err = ofnode_read_u32(dev_ofnode(dev), "regmap", &phandle);
|
||||||
"regmap", &syscon);
|
if (err)
|
||||||
if (err) {
|
|
||||||
pr_err("unable to find syscon device\n");
|
|
||||||
return 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) {
|
if (!priv->regmap) {
|
||||||
pr_err("unable to find regmap\n");
|
pr_err("unable to find regmap\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
Loading…
Reference in New Issue
Block a user