syscon: update syscon_regmap_lookup_by_phandle

Change the function syscon_regmap_lookup_by_phandle()
introduced by commit 6c3af1f24e4b ("syscon: dm: Add a
new method to get a regmap from DTS") to have
Linux-compatible syscon API.

Same modification than commit e151a1c288bd ("syscon: add
Linux-compatible syscon API") solves issue when the node
identified by the phandle has several compatibles and is
already bound to a dedicated driver.

See Linux commit bdb0066df96e ("mfd: syscon: Decouple syscon
interface from platform devices").

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
diff --git a/test/dm/syscon.c b/test/dm/syscon.c
index a294dda..0ff9da7 100644
--- a/test/dm/syscon.c
+++ b/test/dm/syscon.c
@@ -67,6 +67,13 @@
 	ut_assert(!IS_ERR(map));
 	ut_asserteq(4, map->range_count);
 
+	ut_assertok_ptr(syscon_regmap_lookup_by_phandle(dev,
+							"third-syscon"));
+	map = syscon_regmap_lookup_by_phandle(dev, "third-syscon");
+	ut_assert(map);
+	ut_assert(!IS_ERR(map));
+	ut_asserteq(4, map->range_count);
+
 	ut_assert(IS_ERR(syscon_regmap_lookup_by_phandle(dev, "not-present")));
 
 	return 0;