From: Biju Das Date: Fri, 12 Nov 2021 18:44:10 +0000 (+0000) Subject: reset: Add of_reset_control_get_optional_exclusive() X-Git-Tag: v6.1-rc5~2227^2~1^2~9^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c4f5b30dda01f2f6979a9681142de454991182ee;p=platform%2Fkernel%2Flinux-starfive.git reset: Add of_reset_control_get_optional_exclusive() Add optional variant of of_reset_control_get_exclusive(). If the requested reset is not specified in the device tree, this function returns NULL instead of an error. Suggested-by: Philipp Zabel Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20211112184413.4391-2-biju.das.jz@bp.renesas.com Signed-off-by: Philipp Zabel --- diff --git a/include/linux/reset.h b/include/linux/reset.h index db0e611..8a21b57 100644 --- a/include/linux/reset.h +++ b/include/linux/reset.h @@ -455,6 +455,26 @@ static inline struct reset_control *of_reset_control_get_exclusive( } /** + * of_reset_control_get_optional_exclusive - Lookup and obtain an optional exclusive + * reference to a reset controller. + * @node: device to be reset by the controller + * @id: reset line name + * + * Optional variant of of_reset_control_get_exclusive(). If the requested reset + * is not specified in the device tree, this function returns NULL instead of + * an error. + * + * Returns a struct reset_control or IS_ERR() condition containing errno. + * + * Use of id names is optional. + */ +static inline struct reset_control *of_reset_control_get_optional_exclusive( + struct device_node *node, const char *id) +{ + return __of_reset_control_get(node, id, 0, false, true, true); +} + +/** * of_reset_control_get_shared - Lookup and obtain a shared reference * to a reset controller. * @node: device to be reset by the controller