@@ -65,15 +65,11 @@ static const struct reset_control_ops sparx5_reset_ops = {
static int mchp_sparx5_map_syscon(struct platform_device *pdev, char *name,
struct regmap **target)
{
- struct device_node *syscon_np;
+ struct device *dev = &pdev->dev;
struct regmap *regmap;
int err;
- syscon_np = of_parse_phandle(pdev->dev.of_node, name, 0);
- if (!syscon_np)
- return -ENODEV;
- regmap = syscon_node_to_regmap(syscon_np);
- of_node_put(syscon_np);
+ regmap = devm_syscon_regmap_lookup_by_phandle(dev, dev->of_node, name);
if (IS_ERR(regmap)) {
err = PTR_ERR(regmap);
dev_err(&pdev->dev, "No '%s' map: %d\n", name, err);