summaryrefslogtreecommitdiffstats
path: root/drivers/clk/clkdev.c
diff options
context:
space:
mode:
authorPhil Edworthy <phil.edworthy@renesas.com>2018-12-03 12:13:08 +0100
committerStephen Boyd <sboyd@kernel.org>2019-02-06 19:32:42 +0100
commit5c56dfe63b6e7da3d9fd84a6c553ff4d2753dd1c (patch)
treec75798256a923e36f9f9273e9e0eb1aff5e1504d /drivers/clk/clkdev.c
parentLinux 5.0-rc1 (diff)
downloadlinux-5c56dfe63b6e7da3d9fd84a6c553ff4d2753dd1c.tar.xz
linux-5c56dfe63b6e7da3d9fd84a6c553ff4d2753dd1c.zip
clk: Add comment about __of_clk_get_by_name() error values
It's not immediately obvious from the code that failure to get a clock provider can return either -ENOENT or -EINVAL. Therefore, add a comment to highlight this. Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Russell King <linux@armlinux.org.uk> [sboyd@kernel.org: Fix comment to be proper C with ==] Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/clkdev.c')
-rw-r--r--drivers/clk/clkdev.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c
index 9ab3db8b3988..5284fd191cca 100644
--- a/drivers/clk/clkdev.c
+++ b/drivers/clk/clkdev.c
@@ -52,6 +52,12 @@ struct clk *of_clk_get(struct device_node *np, int index)
}
EXPORT_SYMBOL(of_clk_get);
+/*
+ * Beware the return values when np is valid, but no clock provider is found.
+ * If name == NULL, the function returns -ENOENT.
+ * If name != NULL, the function returns -EINVAL. This is because __of_clk_get()
+ * is called even if of_property_match_string() returns an error.
+ */
static struct clk *__of_clk_get_by_name(struct device_node *np,
const char *dev_id,
const char *name)