power: reset: syscon-poweroff: get regmap from parent node

Just like syscon-reboot device, the syscon-poweroff is supposed to be a
child of syscon node, thus we can take the same approach as
syscon-poweroff: deprecate the 'regmap' field in favor of taking it from
the parent's node.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230901120057.47018-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
Krzysztof Kozlowski 2023-09-01 14:00:57 +02:00 committed by Sebastian Reichel
parent 6f9c8a1338
commit 92bbb93aaa

View file

@ -37,8 +37,11 @@ static int syscon_poweroff_probe(struct platform_device *pdev)
map = syscon_regmap_lookup_by_phandle(dev->of_node, "regmap");
if (IS_ERR(map)) {
dev_err(dev, "unable to get syscon");
return PTR_ERR(map);
map = syscon_node_to_regmap(dev->parent->of_node);
if (IS_ERR(map)) {
dev_err(dev, "unable to get syscon");
return PTR_ERR(map);
}
}
if (of_property_read_u32(dev->of_node, "offset", &offset)) {