linux-mips
[Top] [All Lists]

Re: [PATCH V2 10/14] MIPS: lantiq: convert falcon debug uart to clkdev a

To: John Crispin <blogic@openwrt.org>
Subject: Re: [PATCH V2 10/14] MIPS: lantiq: convert falcon debug uart to clkdev api
From: Sergei Shtylyov <sshtylyov@mvista.com>
Date: Fri, 24 Feb 2012 14:53:18 +0400
Authentication-results: mr.google.com; spf=pass (google.com: domain of sshtylyov@mvista.com designates 10.205.134.1 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-10-git-send-email-blogic@openwrt.org>
References: <1330012993-13510-1-git-send-email-blogic@openwrt.org> <1330012993-13510-10-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:

On Falcon SoCs we have a secondary serial port that can be used to help
debug the voice core. For the port to work several clocking bits need to
be activated. We convert the code to clkdev api.

You also convert to new ltq_gpio_request() here. I don't think you should mix these two things up in one patch.

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

diff --git a/drivers/tty/serial/lantiq.c b/drivers/tty/serial/lantiq.c
index 99fb70f..cf88afd 100644
--- a/drivers/tty/serial/lantiq.c
+++ b/drivers/tty/serial/lantiq.c
[...]
@@ -529,6 +533,19 @@ lqasc_request_port(struct uart_port *port)
                if (port->membase == NULL)
                        return -ENOMEM;
        }
+
+       if (ltq_is_falcon()&&  (port->line == 1)) {
+               struct ltq_uart_port *ltq_port = lqasc_port[pdev->id];
+               if (ltq_gpio_request(&pdev->dev, MUXC_SIF_RX_PIN,
+                               3, 0, "asc1-rx") ||
+                       ltq_gpio_request(&pdev->dev, MUXC_SIF_TX_PIN,
+                               3, 1, "asc1-tx"))
+                       return -EBUSY;
+               ltq_port->clk = clk_get(&pdev->dev, NULL);
+               if (!ltq_port->clk)

   clk_get() returns error code, not NULL. Use IS_ERR() and PTR_ERR().

WBR, Sergei

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