diff options
author | Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> | 2023-09-01 14:00:57 +0200 |
---|---|---|
committer | Sebastian Reichel <sebastian.reichel@collabora.com> | 2023-09-12 21:07:14 +0200 |
commit | 92bbb93aaaefe14c01eac18df46f8260ee4c2825 (patch) | |
tree | 0a694f777fd7120342dcd259f5af8c683ae61f3b /drivers/power/reset/syscon-poweroff.c | |
parent | power: reset: syscon-poweroff: simplify pdev->dev usage (diff) | |
download | linux-92bbb93aaaefe14c01eac18df46f8260ee4c2825.tar.xz linux-92bbb93aaaefe14c01eac18df46f8260ee4c2825.zip |
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>
Diffstat (limited to 'drivers/power/reset/syscon-poweroff.c')
-rw-r--r-- | drivers/power/reset/syscon-poweroff.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/power/reset/syscon-poweroff.c b/drivers/power/reset/syscon-poweroff.c index 9ef7eef4c979..c3aab7f59345 100644 --- a/drivers/power/reset/syscon-poweroff.c +++ b/drivers/power/reset/syscon-poweroff.c @@ -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)) { |