On Tue, 10 Nov 2020, Enric Balletbo i Serra wrote:
This adds syscon_regmap_lookup_by_phandle_optional() function to get an
optional regmap.
It behaves the same as syscon_regmap_lookup_by_phandle() except where
there is no regmap phandle. In this case, instead of returning -ENODEV,
the function returns NULL. This makes error checking simpler when the
regmap phandle is optional.
Suggested-by: Nicolas Boichat <drinkcat@xxxxxxxxxxxx>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@xxxxxxxxxxxxx>
Reviewed-by: Matthias Brugger <matthias.bgg@xxxxxxxxx>
---
Changes in v2:
- Add Matthias r-b tag.
- Add the explanation from the patch description to the code.
- Return NULL instead of -ENOTSUPP when regmap helpers are not enabled.
drivers/mfd/syscon.c | 18 ++++++++++++++++++
include/linux/mfd/syscon.h | 11 +++++++++++
2 files changed, 29 insertions(+)
Applied, thanks.