lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 03 Jul 2014 17:50:30 +0400
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	Manuel Lauss <manuel.lauss@...il.com>,
	Linux-MIPS <linux-mips@...ux-mips.org>,
	Mike Turquette <mturquette@...aro.org>
CC:	linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH v2 05/11] MIPS: Alchemy: pci: use clk framework to
 enable PCI clock

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@...il.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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ