]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
clk: Add comment about __of_clk_get_by_name() error values
authorPhil Edworthy <phil.edworthy@renesas.com>
Mon, 3 Dec 2018 11:13:08 +0000 (11:13 +0000)
committerStephen Boyd <sboyd@kernel.org>
Wed, 6 Feb 2019 18:32:42 +0000 (10:32 -0800)
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>
drivers/clk/clkdev.c

index 9ab3db8b3988375d02b88c5e76f0843a9a6c475f..5284fd191cca5d77e51ca1a397a6fa2d23caf64b 100644 (file)
@@ -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)