linux-mips
[Top] [All Lists]

Re: [PATCH V2 08/14] MIPS: lantiq: convert falcon gpio to clkdev api

To: John Crispin <blogic@openwrt.org>
Subject: Re: [PATCH V2 08/14] MIPS: lantiq: convert falcon gpio to clkdev api
From: Sergei Shtylyov <sshtylyov@mvista.com>
Date: Fri, 24 Feb 2012 14:45:46 +0400
Authentication-results: mr.google.com; spf=pass (google.com: domain of sshtylyov@mvista.com designates 10.204.128.75 as permitted sender) smtp.mail=sshtylyov@mvista.com
Cc: Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org
In-reply-to: <1330012993-13510-8-git-send-email-blogic@openwrt.org>
References: <1330012993-13510-1-git-send-email-blogic@openwrt.org> <1330012993-13510-8-git-send-email-blogic@openwrt.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2
Hello.

On 23-02-2012 20:03, John Crispin wrote:

The falcon gpio clocks used to be enabled when registering the platform device.
Move this code into the driver and use clkdev api.

Signed-off-by: John Crispin<blogic@openwrt.org>
[...]

diff --git a/arch/mips/lantiq/falcon/gpio.c b/arch/mips/lantiq/falcon/gpio.c
index b7611d7..89c9896 100644
--- a/arch/mips/lantiq/falcon/gpio.c
+++ b/arch/mips/lantiq/falcon/gpio.c
[...]
@@ -332,6 +333,14 @@ falcon_gpio_probe(struct platform_device *pdev)
                goto err;
        }

+       gpio_port->clk = clk_get(&pdev->dev, NULL);
+       if (!gpio_port->clk) {

   clk_get() returns error, not NULL. So you should use IS_ERR(gpio_port->clk).

+               dev_err(&pdev->dev, "Could not get clock\n");
+               ret = -ENOENT;

        ret = PTR_ERR(gpio_port->clk);

WBR, Sergei

<Prev in Thread] Current Thread [Next in Thread>