From: Shubhrajyoti Datta <omaplinuxkernel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Linus Walleij <linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
Cc: Ben Dooks <ben-i2c-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>,
Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Linus Walleij
<linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH 1/2] i2c: stu300: use clk_prepare/unprepare
Date: Wed, 13 Jun 2012 11:52:47 +0530 [thread overview]
Message-ID: <CAM=Q2ct+-URf8VT569Re2GTOFsVQLLspV6EyEj0GAt9qvn67Hg@mail.gmail.com> (raw)
In-Reply-To: <1339522410-570-1-git-send-email-linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
Hi Linus,
On Tue, Jun 12, 2012 at 11:03 PM, Linus Walleij
<linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org> wrote:
> From: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
>
> 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 <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> ---
> drivers/i2c/busses/i2c-stu300.c | 4 +++-
> 1 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)
>
> dev->speed = scl_frequency;
>
> - clk_enable(dev->clk);
> + clk_prepare_enable(dev->clk);
> ret = stu300_init_hw(dev);
> clk_disable(dev->clk);
>
> @@ -960,6 +960,7 @@ stu300_probe(struct platform_device *pdev)
>
> err_add_adapter:
> err_init_hw:
> + clk_unprepare(dev->clk);
So this also fixes an earlier lack of disable also?
> free_irq(dev->irq, dev);
> err_no_irq:
> iounmap(dev->virtbase);
> @@ -1016,6 +1017,7 @@ stu300_remove(struct platform_device *pdev)
> free_irq(dev->irq, dev);
> iounmap(dev->virtbase);
> release_mem_region(dev->phybase, dev->physize);
> + clk_unprepare(dev->clk);
> clk_put(dev->clk);
> platform_set_drvdata(pdev, NULL);
> kfree(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 http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2012-06-13 6:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-12 17:33 [PATCH 1/2] i2c: stu300: use clk_prepare/unprepare Linus Walleij
[not found] ` <1339522410-570-1-git-send-email-linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
2012-06-13 6:22 ` Shubhrajyoti Datta [this message]
[not found] ` <CAM=Q2ct+-URf8VT569Re2GTOFsVQLLspV6EyEj0GAt9qvn67Hg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-06-14 7:17 ` Linus Walleij
2012-07-09 12:20 ` Wolfram Sang
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='CAM=Q2ct+-URf8VT569Re2GTOFsVQLLspV6EyEj0GAt9qvn67Hg@mail.gmail.com' \
--to=omaplinuxkernel-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=ben-i2c-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
--cc=linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org \
--cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).