All of lore.kernel.org
 help / color / mirror / Atom feed
From: mturquette@linaro.org (Mike Turquette)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv2 1/3] clk: wm831x: Fix clk_register() error code checking
Date: Mon, 29 Oct 2012 11:13:49 -0700	[thread overview]
Message-ID: <20121029181349.18780.28418@nucleus> (raw)
In-Reply-To: <1348519085-5888-1-git-send-email-sboyd@codeaurora.org>

Quoting Stephen Boyd (2012-09-24 13:38:03)
> clk_register() returns an ERR_PTR upon failure, not NULL. Fix
> these error paths.
> 
> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

Thanks for sending V2.  Taken into clk-next.

Regards,
Mike

> ---
> 
> v2: No changes
> 
>  drivers/clk/clk-wm831x.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/clk/clk-wm831x.c b/drivers/clk/clk-wm831x.c
> index e7b7765..eb1afaf 100644
> --- a/drivers/clk/clk-wm831x.c
> +++ b/drivers/clk/clk-wm831x.c
> @@ -371,20 +371,20 @@ static __devinit int wm831x_clk_probe(struct platform_device *pdev)
>  
>         clkdata->xtal_hw.init = &wm831x_xtal_init;
>         clkdata->xtal = clk_register(&pdev->dev, &clkdata->xtal_hw);
> -       if (!clkdata->xtal)
> -               return -EINVAL;
> +       if (IS_ERR(clkdata->xtal))
> +               return PTR_ERR(clkdata->xtal);
>  
>         clkdata->fll_hw.init = &wm831x_fll_init;
>         clkdata->fll = clk_register(&pdev->dev, &clkdata->fll_hw);
> -       if (!clkdata->fll) {
> -               ret = -EINVAL;
> +       if (IS_ERR(clkdata->fll)) {
> +               ret = PTR_ERR(clkdata->fll);
>                 goto err_xtal;
>         }
>  
>         clkdata->clkout_hw.init = &wm831x_clkout_init;
>         clkdata->clkout = clk_register(&pdev->dev, &clkdata->clkout_hw);
> -       if (!clkdata->clkout) {
> -               ret = -EINVAL;
> +       if (IS_ERR(clkdata->clkout)) {
> +               ret = PTR_ERR(clkdata->clkout);
>                 goto err_fll;
>         }
>  
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> hosted by The Linux Foundation

      parent reply	other threads:[~2012-10-29 18:13 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-19  6:05 [PATCH 0/3] Introduce devm_clk_register() Stephen Boyd
2012-09-19  6:05 ` Stephen Boyd
2012-09-19  6:05 ` [PATCH 1/3] clk: wm831x: Fix clk_register() error code checking Stephen Boyd
2012-09-19  6:05   ` Stephen Boyd
2012-09-20  1:31   ` Mark Brown
2012-09-20  1:31     ` Mark Brown
2012-09-19  6:05 ` [PATCH 2/3] clk: Add devm_clk_{register,unregister}() Stephen Boyd
2012-09-19  6:05   ` Stephen Boyd
2012-09-21  2:33   ` Stephen Boyd
2012-09-21  2:33     ` Stephen Boyd
2012-09-22  1:07     ` Mike Turquette
2012-09-22  7:20       ` Stephen Boyd
2012-09-22  7:20         ` Stephen Boyd
2012-09-19  6:05 ` [PATCH 3/3] clk: wm831x: Use devm_clk_register() to simplify code Stephen Boyd
2012-09-19  6:05   ` Stephen Boyd
2012-09-20  1:40   ` Mark Brown
2012-09-20  1:40     ` Mark Brown
2012-09-22 10:06 ` [PATCH 0/3] Introduce devm_clk_register() Russell King - ARM Linux
2012-09-22 10:06   ` Russell King - ARM Linux
2012-09-24 20:20   ` Stephen Boyd
2012-09-24 20:20     ` Stephen Boyd
2012-09-24 20:35     ` Russell King - ARM Linux
2012-09-24 20:35       ` Russell King - ARM Linux
2012-09-24 20:38 ` [PATCHv2 1/3] clk: wm831x: Fix clk_register() error code checking Stephen Boyd
2012-09-24 20:38   ` Stephen Boyd
2012-09-24 20:38   ` [PATCHv2 2/3] clk: Add devm_clk_{register,unregister}() Stephen Boyd
2012-09-24 20:38     ` Stephen Boyd
2012-09-24 20:38   ` [PATCHv2 3/3] clk: wm831x: Use devm_clk_register() to simplify code Stephen Boyd
2012-09-24 20:38     ` Stephen Boyd
2012-10-29 18:13   ` Mike Turquette [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121029181349.18780.28418@nucleus \
    --to=mturquette@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.