From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shubhrajyoti Datta Subject: Re: [PATCH 1/2] i2c: stu300: use clk_prepare/unprepare Date: Wed, 13 Jun 2012 11:52:47 +0530 Message-ID: References: <1339522410-570-1-git-send-email-linus.walleij@stericsson.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <1339522410-570-1-git-send-email-linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org> Sender: linux-i2c-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Linus Walleij Cc: Ben Dooks , Wolfram Sang , linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linus Walleij List-Id: linux-i2c@vger.kernel.org Hi Linus, On Tue, Jun 12, 2012 at 11:03 PM, Linus Walleij wrote: > From: Linus Walleij > > Make sure we prepare/unprepare the clock for the ST U300 > I2C driver as is required by the clk API especially if you > use common clock. Not a comment rather a doubt. The transfer is still using enable and disable? Can you help me understand the difference. > > Signed-off-by: Linus Walleij > --- > =A0drivers/i2c/busses/i2c-stu300.c | =A0 =A04 +++- > =A01 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c= -stu300.c > index 4d44af1..79b7851 100644 > --- a/drivers/i2c/busses/i2c-stu300.c > +++ b/drivers/i2c/busses/i2c-stu300.c > @@ -924,7 +924,7 @@ stu300_probe(struct platform_device *pdev) > > =A0 =A0 =A0 =A0dev->speed =3D scl_frequency; > > - =A0 =A0 =A0 clk_enable(dev->clk); > + =A0 =A0 =A0 clk_prepare_enable(dev->clk); > =A0 =A0 =A0 =A0ret =3D stu300_init_hw(dev); > =A0 =A0 =A0 =A0clk_disable(dev->clk); > > @@ -960,6 +960,7 @@ stu300_probe(struct platform_device *pdev) > > =A0err_add_adapter: > =A0err_init_hw: > + =A0 =A0 =A0 clk_unprepare(dev->clk); So this also fixes an earlier lack of disable also? > =A0 =A0 =A0 =A0free_irq(dev->irq, dev); > =A0err_no_irq: > =A0 =A0 =A0 =A0iounmap(dev->virtbase); > @@ -1016,6 +1017,7 @@ stu300_remove(struct platform_device *pdev) > =A0 =A0 =A0 =A0free_irq(dev->irq, dev); > =A0 =A0 =A0 =A0iounmap(dev->virtbase); > =A0 =A0 =A0 =A0release_mem_region(dev->phybase, dev->physize); > + =A0 =A0 =A0 clk_unprepare(dev->clk); > =A0 =A0 =A0 =A0clk_put(dev->clk); > =A0 =A0 =A0 =A0platform_set_drvdata(pdev, NULL); > =A0 =A0 =A0 =A0kfree(dev); > -- > 1.7.9.2 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-i2c" = in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at =A0http://vger.kernel.org/majordomo-info.html