2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-20 19:23:57 +08:00

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 <Sergey.Semin@baikalelectronics.ru>
Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
Serge Semin 2020-05-26 16:51:01 +03:00 committed by Sebastian Reichel
parent 2140d68d69
commit c3d8052223

View File

@ -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;