From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Manuel Lauss <manuel.lauss@gmail.com>,
Linux-MIPS <linux-mips@linux-mips.org>,
Mike Turquette <mturquette@linaro.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH v2 05/11] MIPS: Alchemy: pci: use clk framework to enable PCI clock
Date: Thu, 03 Jul 2014 17:50:30 +0400 [thread overview]
Message-ID: <53B55FA6.5080801@cogentembedded.com> (raw)
In-Reply-To: <1404393762-858019-6-git-send-email-manuel.lauss@gmail.com>
Hello.
On 07/03/2014 05:22 PM, Manuel Lauss wrote:
> Use the clock framework to get at the PCI clock source and enable
> it on driver initialization.
> Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
> ---
> arch/mips/pci/pci-alchemy.c | 23 ++++++++++++++++++++++-
> 1 file changed, 22 insertions(+), 1 deletion(-)
> diff --git a/arch/mips/pci/pci-alchemy.c b/arch/mips/pci/pci-alchemy.c
> index 912c5f2..adc810f 100644
> --- a/arch/mips/pci/pci-alchemy.c
> +++ b/arch/mips/pci/pci-alchemy.c
[...]
> @@ -394,11 +396,24 @@ static int alchemy_pci_probe(struct platform_device *pdev)
> goto out1;
> }
>
> + c = clk_get(&pdev->dev, "pci_clko");
> + if (IS_ERR(c)) {
> + dev_err(&pdev->dev, "unable to find PCI clock\n");
> + ret = PTR_ERR(c);
> + goto out2;
> + }
> + ret = clk_prepare_enable(c);
> + if (ret) {
> + dev_err(&pdev->dev, "cannot enable PCI clock\n");
> + clk_put(c);
> + goto out2;
Isn't it simpler to add one more label before clk_put() at end of function?
> + }
> +
[...]
> @@ -466,12 +481,18 @@ static int alchemy_pci_probe(struct platform_device *pdev)
> register_syscore_ops(&alchemy_pci_pmops);
> register_pci_controller(&ctx->alchemy_pci_ctrl);
>
> + dev_info(&pdev->dev, "PCI controller at %ld MHz\n",
> + clk_get_rate(c) / 1000000);
> +
> return 0;
>
> out4:
> iounmap(virt_io);
> out3:
> iounmap(ctx->regs);
> +out5:
> + clk_disable_unprepare(c);
> + clk_put(c);
> out2:
> release_mem_region(r->start, resource_size(r));
> out1:
>
WBR, Sergei
next prev parent reply other threads:[~2014-07-03 13:50 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-03 13:22 [RFC PATCH v2 00/11] MIPS: Alchemy: clock framework support Manuel Lauss
2014-07-03 13:22 ` [RFC PATCH v2 01/11] MIPS: Alchemy: au1000 header file cleanup Manuel Lauss
2014-07-03 13:22 ` [RFC PATCH v2 02/11] MIPS: Alchemy: clock framework integration of onchip clocks Manuel Lauss
2014-07-03 13:22 ` [RFC PATCH v2 03/11] MIPS: Alchemy: platform: use clk framework for uarts Manuel Lauss
2014-07-03 13:22 ` [RFC PATCH v2 04/11] MIPS: Alchemy: usb: use clk framework Manuel Lauss
2014-07-03 13:22 ` [RFC PATCH v2 05/11] MIPS: Alchemy: pci: use clk framework to enable PCI clock Manuel Lauss
2014-07-03 13:50 ` Sergei Shtylyov [this message]
2014-07-03 17:19 ` Manuel Lauss
2014-07-03 13:22 ` [RFC PATCH v2 06/11] MIPS: Alchemy: db1200: use clk framework Manuel Lauss
2014-07-03 13:22 ` [RFC PATCH v2 07/11] MIPS: Alchemy: irda: " Manuel Lauss
2014-07-03 13:22 ` [RFC PATCH v2 08/11] MIPS: Alchemy: au1100fb: " Manuel Lauss
2014-07-03 13:22 ` [RFC PATCH v2 09/11] MIPS: Alchemy: au1200fb: " Manuel Lauss
2014-07-03 13:22 ` [RFC PATCH v2 10/11] MIPS: Alchemy: au1xmmc: " Manuel Lauss
2014-07-03 13:22 ` [RFC PATCH v2 11/11] MIPS: Alchemy: remove old clock support Manuel Lauss
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=53B55FA6.5080801@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=manuel.lauss@gmail.com \
--cc=mturquette@linaro.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