Commit 1f6ca3f42f6edf143473159297f4c515b1cf36f6
Committed by
Tom Rini
1 parent
af95a3e7c0
Exists in
smarc_8mq_lf_v2020.04
and in
11 other branches
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>
Showing 1 changed file with 9 additions and 7 deletions Side-by-side Diff
drivers/sysreset/sysreset_syscon.c
... | ... | @@ -35,18 +35,20 @@ |
35 | 35 | |
36 | 36 | int syscon_reboot_probe(struct udevice *dev) |
37 | 37 | { |
38 | - struct udevice *syscon; | |
39 | 38 | struct syscon_reboot_priv *priv = dev_get_priv(dev); |
40 | 39 | int err; |
40 | + u32 phandle; | |
41 | + ofnode node; | |
41 | 42 | |
42 | - err = uclass_get_device_by_phandle(UCLASS_SYSCON, dev, | |
43 | - "regmap", &syscon); | |
44 | - if (err) { | |
45 | - pr_err("unable to find syscon device\n"); | |
43 | + err = ofnode_read_u32(dev_ofnode(dev), "regmap", &phandle); | |
44 | + if (err) | |
46 | 45 | return err; |
47 | - } | |
48 | 46 | |
49 | - priv->regmap = syscon_get_regmap(syscon); | |
47 | + node = ofnode_get_by_phandle(phandle); | |
48 | + if (!ofnode_valid(node)) | |
49 | + return -EINVAL; | |
50 | + | |
51 | + priv->regmap = syscon_node_to_regmap(node); | |
50 | 52 | if (!priv->regmap) { |
51 | 53 | pr_err("unable to find regmap\n"); |
52 | 54 | return -ENODEV; |