Commit c4f5b30d authored by Biju Das's avatar Biju Das Committed by Philipp Zabel

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: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarBiju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20211112184413.4391-2-biju.das.jz@bp.renesas.comSigned-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
parent fa55b7dc
...@@ -454,6 +454,26 @@ static inline struct reset_control *of_reset_control_get_exclusive( ...@@ -454,6 +454,26 @@ static inline struct reset_control *of_reset_control_get_exclusive(
return __of_reset_control_get(node, id, 0, false, false, true); return __of_reset_control_get(node, id, 0, false, false, true);
} }
/**
* 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 * of_reset_control_get_shared - Lookup and obtain a shared reference
* to a reset controller. * to a reset controller.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment