[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181116145937.27660-7-phil.edworthy@renesas.com>
Date: Fri, 16 Nov 2018 14:59:37 +0000
From: Phil Edworthy <phil.edworthy@...esas.com>
To: unlisted-recipients:; (no To-header on input)
Cc: linux-clk@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-renesas-soc@...r.kernel.org,
Phil Edworthy <phil.edworthy@...esas.com>,
Guan Xuetao <gxt@....edu.cn>
Subject: [PATCH v6 6/6] arch/unicore32/kernel/clock.c: Add clk_get_optional() function
clk_get_optional() returns NULL if not found instead of -ENOENT,
otherwise the behaviour is the same as clk_get().
Signed-off-by: Phil Edworthy <phil.edworthy@...esas.com>
---
arch/unicore32/kernel/clock.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/arch/unicore32/kernel/clock.c b/arch/unicore32/kernel/clock.c
index b1ca775f6f6e..03def0b43192 100644
--- a/arch/unicore32/kernel/clock.c
+++ b/arch/unicore32/kernel/clock.c
@@ -74,6 +74,17 @@ struct clk *clk_get(struct device *dev, const char *id)
}
EXPORT_SYMBOL(clk_get);
+struct clk *clk_get_optional(struct device *dev, const char *id)
+{
+ struct clk *clk = clk_get(dev, id);
+
+ if (clk == ERR_PTR(-ENOENT))
+ clk = NULL;
+
+ return clk;
+}
+EXPORT_SYMBOL(clk_get_optional);
+
void clk_put(struct clk *clk)
{
}
--
2.17.1
Powered by blists - more mailing lists