All of lore.kernel.org
 help / color / mirror / Atom feed
From: Biju Das <biju.das.jz@bp.renesas.com>
To: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Biju Das <biju.das.jz@bp.renesas.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Chris Paterson <Chris.Paterson2@renesas.com>,
	Biju Das <biju.das@bp.renesas.com>,
	Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	linux-renesas-soc@vger.kernel.org
Subject: [PATCH v3 1/4] reset: Add of_reset_control_get_optional_exclusive()
Date: Fri, 12 Nov 2021 18:44:10 +0000	[thread overview]
Message-ID: <20211112184413.4391-2-biju.das.jz@bp.renesas.com> (raw)
In-Reply-To: <20211112184413.4391-1-biju.das.jz@bp.renesas.com>

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(+)

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.
-- 
2.17.1


  reply	other threads:[~2021-11-12 18:44 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-12 18:44 [PATCH v3 0/4] Add RZ/G2L OSTM support Biju Das
2021-11-12 18:44 ` Biju Das
2021-11-12 18:44 ` Biju Das [this message]
2021-11-19 11:37   ` [PATCH v3 1/4] reset: Add of_reset_control_get_optional_exclusive() Philipp Zabel
2021-12-09 13:09     ` Daniel Lezcano
2022-01-10 13:00   ` [tip: timers/core] " tip-bot2 for Biju Das
2021-11-12 18:44 ` [PATCH v3 2/4] dt-bindings: timer: renesas: ostm: Document Renesas RZ/G2L OSTM Biju Das
2021-11-12 18:44   ` Biju Das
2021-11-29  0:06   ` Rob Herring
2021-11-29  0:06     ` Rob Herring
2022-01-10 12:59   ` [tip: timers/core] " tip-bot2 for Biju Das
2021-11-12 18:44 ` [PATCH v3 3/4] clocksource/drivers/renesas-ostm: Add RZ/G2L OSTM support Biju Das
2021-11-12 18:44   ` Biju Das
2021-11-18 10:44   ` Geert Uytterhoeven
2021-11-18 10:44     ` Geert Uytterhoeven
2021-11-29  9:53   ` Daniel Lezcano
2021-11-29  9:53     ` Daniel Lezcano
2021-11-29 10:05     ` Biju Das
2021-11-29 10:05       ` Biju Das
2021-11-29 10:15       ` Geert Uytterhoeven
2021-11-29 10:15         ` Geert Uytterhoeven
2021-12-07 13:32         ` Biju Das
2021-12-07 13:32           ` Biju Das
2021-12-09 13:10           ` Daniel Lezcano
2021-12-09 13:10             ` Daniel Lezcano
2022-01-10 12:59   ` [tip: timers/core] " tip-bot2 for Biju Das
2021-11-12 18:44 ` [PATCH v3 4/4] clocksource/drivers/renesas,ostm: Make RENESAS_OSTM symbol visible Biju Das
2021-11-18 10:40   ` Geert Uytterhoeven
2022-01-10 12:59   ` [tip: timers/core] " tip-bot2 for Biju Das

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211112184413.4391-2-biju.das.jz@bp.renesas.com \
    --to=biju.das.jz@bp.renesas.com \
    --cc=Chris.Paterson2@renesas.com \
    --cc=biju.das@bp.renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.