Subject: [PATCH V4] clk: add a fixed factor clock

From: [email-masked] (Mike Turquette)
Date: Sun, 6 May 2012 18:42:41 -0700

On 20120503-19:11, viresh kumar wrote:
> On May 3, 2012 5:38 PM, "Sascha Hauer" <[email-masked]> wrote:
> >
> 
> > > +     if (clk)
> > > +             return clk;
> >
> >        if (!IS_ERR(clk))
> 
> Oops. @Mike: can you please fix it while applying?

I've applied the below fix in my local branch.  Let me know if you have
issue with it before I send out my pull request to Arnd.

Thanks,
Mike

diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-factor.c
index 0e8782b..1f2da01 100644
--- a/drivers/clk/clk-fixed-factor.c
+++ b/drivers/clk/clk-fixed-factor.c
@@ -88,10 +88,8 @@ struct clk *clk_register_fixed_factor(struct device *dev, const char *name,
 
 	clk = clk_register(dev, &fix->hw);
 
-	if (clk)
-		return clk;
+	if (IS_ERR(clk))
+		kfree(fix);
 
-	kfree(fix);
-
-	return NULL;
+	return clk;
 }