From a442e61e245824f2cf7d7cf43844ac90e5d7e7a4 Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Thu, 7 Mar 2019 09:57:13 +0100 Subject: 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 Reviewed-by: Simon Glass --- test/dm/syscon.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test') diff --git a/test/dm/syscon.c b/test/dm/syscon.c index a294dda02e..0ff9da7ec6 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; -- cgit v1.2.1