aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@st.com>2019-03-07 09:57:13 +0100
committerSimon Glass <sjg@chromium.org>2019-04-11 20:10:05 -0600
commita442e61e245824f2cf7d7cf43844ac90e5d7e7a4 (patch)
treea2ff9d3b2659d46d461f695f8d8f0eb1432565c5 /test
parent1ceb10b4d872b29ba251bc49665f1b8812d70acf (diff)
downloadu-boot-a442e61e245824f2cf7d7cf43844ac90e5d7e7a4.zip
u-boot-a442e61e245824f2cf7d7cf43844ac90e5d7e7a4.tar.gz
u-boot-a442e61e245824f2cf7d7cf43844ac90e5d7e7a4.tar.bz2
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>
Diffstat (limited to 'test')
-rw-r--r--test/dm/syscon.c7
1 files changed, 7 insertions, 0 deletions
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 @@ 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;