syscon: update syscon_regmap_lookup_by_phandle

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

Same modification than commit e151a1c288 ("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>
This commit is contained in:
Patrick Delaunay
2019-03-07 09:57:13 +01:00
committed by Simon Glass
parent 1ceb10b4d8
commit a442e61e24
3 changed files with 68 additions and 25 deletions

View File

@@ -67,6 +67,13 @@ static int dm_test_syscon_by_phandle(struct unit_test_state *uts)
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;