aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerge Semin <[email protected]>2020-05-26 16:51:01 +0300
committerSebastian Reichel <[email protected]>2020-05-28 09:00:30 +0200
commitc3d80522237b71480109fc397975fe4146ed2550 (patch)
tree9ccd527cd7d4e7f7ee89d7f4c87244690bdf8734
parent2140d68d69d45e4a74ec09ca381d2c8879165d2d (diff)
power: reset: syscon-reboot: Add parental syscon support
Since normally syscon-reboot block is supposed to be a part of a system controller, lets look for the syscon regmap in a parental DT node if regmap property isn't specified. DT binding from now considers the regmap property as deprecated. Signed-off-by: Serge Semin <[email protected]> Cc: Alexey Malahov <[email protected]> Cc: Thomas Bogendoerfer <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
-rw-r--r--drivers/power/reset/syscon-reboot.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/power/reset/syscon-reboot.c b/drivers/power/reset/syscon-reboot.c
index 62fbba0df971..510e363381ca 100644
--- a/drivers/power/reset/syscon-reboot.c
+++ b/drivers/power/reset/syscon-reboot.c
@@ -51,8 +51,11 @@ static int syscon_reboot_probe(struct platform_device *pdev)
return -ENOMEM;
ctx->map = syscon_regmap_lookup_by_phandle(dev->of_node, "regmap");
- if (IS_ERR(ctx->map))
- return PTR_ERR(ctx->map);
+ if (IS_ERR(ctx->map)) {
+ ctx->map = syscon_node_to_regmap(dev->parent->of_node);
+ if (IS_ERR(ctx->map))
+ return PTR_ERR(ctx->map);
+ }
if (of_property_read_u32(pdev->dev.of_node, "offset", &ctx->offset))
return -EINVAL;