Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1604360 > unrolled thread
| Started by | Philipp Zabel <p.zabel@pengutronix.de> |
|---|---|
| First post | 2017-03-20 11:50 +0100 |
| Last post | 2017-03-20 12:10 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] reset: fix optional reset_control_get stubs to return NULL Philipp Zabel <p.zabel@pengutronix.de> - 2017-03-20 11:50 +0100
Re: [PATCH] reset: fix optional reset_control_get stubs to return NULL Andrzej Hajda <a.hajda@samsung.com> - 2017-03-20 12:10 +0100
| From | Philipp Zabel <p.zabel@pengutronix.de> |
|---|---|
| Date | 2017-03-20 11:50 +0100 |
| Subject | [PATCH] reset: fix optional reset_control_get stubs to return NULL |
| Message-ID | <tn32W-3u2-17@gated-at.bofh.it> |
When RESET_CONTROLLER is not enabled, the optional reset_control_get
stubs should now also return NULL.
Fixes: bb475230b8e5 ("reset: make optional functions really optional")
Reported-by: Andrzej Hajda <a.hajda@samsung.com>
Cc: Ramiro Oliveira <Ramiro.Oliveira@synopsys.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
include/linux/reset.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/reset.h b/include/linux/reset.h
index 86b4ed75359e8..c905ff1c21ec6 100644
--- a/include/linux/reset.h
+++ b/include/linux/reset.h
@@ -74,14 +74,14 @@ static inline struct reset_control *__of_reset_control_get(
const char *id, int index, bool shared,
bool optional)
{
- return ERR_PTR(-ENOTSUPP);
+ return optional ? NULL : ERR_PTR(-ENOTSUPP);
}
static inline struct reset_control *__devm_reset_control_get(
struct device *dev, const char *id,
int index, bool shared, bool optional)
{
- return ERR_PTR(-ENOTSUPP);
+ return optional ? NULL : ERR_PTR(-ENOTSUPP);
}
#endif /* CONFIG_RESET_CONTROLLER */
--
2.11.0
[toc] | [next] | [standalone]
| From | Andrzej Hajda <a.hajda@samsung.com> |
|---|---|
| Date | 2017-03-20 12:10 +0100 |
| Message-ID | <tn3mj-3Qx-41@gated-at.bofh.it> |
| In reply to | #1604360 |
On 20.03.2017 11:42, Philipp Zabel wrote:
> When RESET_CONTROLLER is not enabled, the optional reset_control_get
> stubs should now also return NULL.
>
> Fixes: bb475230b8e5 ("reset: make optional functions really optional")
> Reported-by: Andrzej Hajda <a.hajda@samsung.com>
> Cc: Ramiro Oliveira <Ramiro.Oliveira@synopsys.com>
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> ---
> include/linux/reset.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/reset.h b/include/linux/reset.h
> index 86b4ed75359e8..c905ff1c21ec6 100644
> --- a/include/linux/reset.h
> +++ b/include/linux/reset.h
> @@ -74,14 +74,14 @@ static inline struct reset_control *__of_reset_control_get(
> const char *id, int index, bool shared,
> bool optional)
> {
> - return ERR_PTR(-ENOTSUPP);
> + return optional ? NULL : ERR_PTR(-ENOTSUPP);
> }
>
> static inline struct reset_control *__devm_reset_control_get(
> struct device *dev, const char *id,
> int index, bool shared, bool optional)
> {
> - return ERR_PTR(-ENOTSUPP);
> + return optional ? NULL : ERR_PTR(-ENOTSUPP);
> }
>
> #endif /* CONFIG_RESET_CONTROLLER */
Such change should be accompanied with change of all other stub
functions to accept NULL reset_control without displaying WARNs.
Regards
Andrzej
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web