lkml.org 
[lkml]   [2018]   [Nov]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v6 3/6] m68k: coldfire: Add clk_get_optional() function
From
Date
Hi Phil,

On 17/11/18 12:59 am, Phil Edworthy wrote:
> 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@renesas.com>

Acked-by: Greg Ungerer <gerg@@linux-m68k.org>

Looks good. Do you want me to take this in the m68knommu git tree?
Or is the whole series going through some other tree?

Regards
Greg



> ---
> arch/m68k/coldfire/clk.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/arch/m68k/coldfire/clk.c b/arch/m68k/coldfire/clk.c
> index 7bc666e482eb..b221cabc7f54 100644
> --- a/arch/m68k/coldfire/clk.c
> +++ b/arch/m68k/coldfire/clk.c
> @@ -87,6 +87,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);
> +
> int clk_enable(struct clk *clk)
> {
> unsigned long flags;
>

\
 
 \ /
  Last update: 2018-11-29 13:04    [W:0.152 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site