Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1373903

Re: [PATCH v2] clk: let clk_disable() return immediately if clk is NULL or error

From Stephen Boyd <sboyd@codeaurora.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2] clk: let clk_disable() return immediately if clk is NULL or error
Date 2016-04-08 02:40 +0200
Message-ID <rlsCT-3LP-33@gated-at.bofh.it> (permalink)
References <rkorE-3JL-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 04/05, Masahiro Yamada wrote:
> The clk_disable() in the common clock framework (drivers/clk/clk.c)
> returns immediately if a given clk is NULL or an error pointer.  It
> allows clock consumers to call clk_disable() without IS_ERR_OR_NULL
> checking if drivers are only used with the common clock framework.
> 
> Unfortunately, NULL/error checking is missing from some of non-common
> clk_disable() implementations.  This prevents us from completely
> dropping NULL/error checking from callers.  Let's make it tree-wide
> consistent by adding IS_ERR_OR_NULL(clk) to all callees.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Acked-by: Greg Ungerer <gerg@uclinux.org>
> Acked-by: Wan Zongshun <mcuos.com@gmail.com>
> ---
> 
> Stephen,
> 
> This patch has been unapplied for a long time.
> 
> Please let me know if there is something wrong with this patch.
> 

I'm mostly confused why we wouldn't want to encourage people to
call clk_disable or unprepare on a clk that's an error pointer.
Typically an error pointer should be dealt with, instead of
silently ignored, so why wasn't it dealt with by passing it up
the probe() path?

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2] clk: let clk_disable() return immediately if clk is NULL or error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-04-05 04:00 +0200
  Re: [PATCH v2] clk: let clk_disable() return immediately if clk is  NULL or error Stephen Boyd <sboyd@codeaurora.org> - 2016-04-08 02:40 +0200
    Re: [PATCH v2] clk: let clk_disable() return immediately if clk is  NULL or error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-04-08 04:00 +0200
      Re: [PATCH v2] clk: let clk_disable() return immediately if clk is  NULL or error Stephen Boyd <sboyd@codeaurora.org> - 2016-04-14 02:40 +0200
        Re: [PATCH v2] clk: let clk_disable() return immediately if clk is  NULL or error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-04-14 03:50 +0200
    Re: [PATCH v2] clk: let clk_disable() return immediately if clk is  NULL or error Ralf Baechle <ralf@linux-mips.org> - 2016-04-08 12:30 +0200
      Re: [PATCH v2] clk: let clk_disable() return immediately if clk is  NULL or error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-04-08 13:20 +0200
      Re: [PATCH v2] clk: let clk_disable() return immediately if clk is  NULL or error Stephen Boyd <sboyd@codeaurora.org> - 2016-04-14 02:50 +0200

csiph-web