@@ -40,6 +40,7 @@ static int syscon_reboot_mode_probe(struct platform_device *pdev)
{
int ret;
struct syscon_reboot_mode *syscon_rbm;
+ struct regmap *map;
syscon_rbm = devm_kzalloc(&pdev->dev, sizeof(*syscon_rbm), GFP_KERNEL);
if (!syscon_rbm)
@@ -49,9 +50,13 @@ static int syscon_reboot_mode_probe(struct platform_device *pdev)
syscon_rbm->reboot.write = syscon_reboot_mode_write;
syscon_rbm->mask = 0xffffffff;
- syscon_rbm->map = syscon_node_to_regmap(pdev->dev.parent->of_node);
- if (IS_ERR(syscon_rbm->map))
- return PTR_ERR(syscon_rbm->map);
+ map = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, "regmap");
+ if (IS_ERR(map)) {
+ map = syscon_node_to_regmap(pdev->dev.parent->of_node);
+ if (IS_ERR(map))
+ return PTR_ERR(map);
+ }
+ syscon_rbm->map = map;
if (of_property_read_u32(pdev->dev.of_node, "offset",
&syscon_rbm->offset))