diff mbox series

[v3,1/4] reset: Add of_reset_control_get_optional_exclusive()

Message ID 20211112184413.4391-2-biju.das.jz@bp.renesas.com (mailing list archive)
State Accepted
Delegated to: Geert Uytterhoeven
Headers show
Series Add RZ/G2L OSTM support | expand

Commit Message

Biju Das Nov. 12, 2021, 6:44 p.m. UTC
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 <p.zabel@pengutronix.de>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v2->v3:
 * Added Geert's Rb tag
---
 include/linux/reset.h | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

Comments

Philipp Zabel Nov. 19, 2021, 11:37 a.m. UTC | #1
Hi Daniel, Thomas,

On Fri, 2021-11-12 at 18:44 +0000, Biju Das wrote:
> 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 <p.zabel@pengutronix.de>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> v2->v3:
>  * Added Geert's Rb tag
> ---

I've picked up this patch for the reset/next branch:

----------8<----------
The following changes since commit fa55b7dcdc43c1aa1ba12bca9d2dd4318c2a0dbf:

  Linux 5.16-rc1 (2021-11-14 13:56:52 -0800)

are available in the Git repository at:

  git://git.pengutronix.de/pza/linux reset/of-get-optional-exclusive

for you to fetch changes up to c4f5b30dda01f2f6979a9681142de454991182ee:

  reset: Add of_reset_control_get_optional_exclusive() (2021-11-19 12:23:45 +0100)

----------------------------------------------------------------
Biju Das (1):
      reset: Add of_reset_control_get_optional_exclusive()

 include/linux/reset.h | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
---------->8----------

Patch 3/4 of the "Add RZ/G2L OSTM support" series depends on it. Let me
know if you prefer this to be merged together with the rest of the
series instad, in which case you'll have my

Acked-by: Philipp Zabel <p.zabel@pengutronix.de>

on the patch and I'll drop it from reset/next.

regards
Philipp
Daniel Lezcano Dec. 9, 2021, 1:09 p.m. UTC | #2
On 19/11/2021 12:37, Philipp Zabel wrote:
> Hi Daniel, Thomas,
> 
> On Fri, 2021-11-12 at 18:44 +0000, Biju Das wrote:
>> 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 <p.zabel@pengutronix.de>
>> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
>> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
>> ---
>> v2->v3:
>>  * Added Geert's Rb tag
>> ---
> 
> I've picked up this patch for the reset/next branch:
> 
> ----------8<----------
> The following changes since commit fa55b7dcdc43c1aa1ba12bca9d2dd4318c2a0dbf:
> 
>   Linux 5.16-rc1 (2021-11-14 13:56:52 -0800)
> 
> are available in the Git repository at:
> 
>   git://git.pengutronix.de/pza/linux reset/of-get-optional-exclusive
> 
> for you to fetch changes up to c4f5b30dda01f2f6979a9681142de454991182ee:
> 
>   reset: Add of_reset_control_get_optional_exclusive() (2021-11-19 12:23:45 +0100)

Thanks, I've merged your branch. Please do not remove it

  -- Daniel
diff mbox series

Patch

diff --git a/include/linux/reset.h b/include/linux/reset.h
index db0e6115a2f6..8a21b5756c3e 100644
--- a/include/linux/reset.h
+++ b/include/linux/reset.h
@@ -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);
 }
 
+/**
+ * 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.