linux-mips
[Top] [All Lists]

Re: [PATCH V2 6/6] MIPS: lantiq: convert gpio_stp to managed gpio

To: John Crispin <blogic@openwrt.org>
Subject: Re: [PATCH V2 6/6] MIPS: lantiq: convert gpio_stp to managed gpio
From: Sergei Shtylyov <sshtylyov@mvista.com>
Date: Fri, 24 Feb 2012 14:39:34 +0400
Authentication-results: mr.google.com; spf=pass (google.com: domain of sshtylyov@mvista.com designates 10.204.154.28 as permitted sender) smtp.mail=sshtylyov@mvista.com
Cc: Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org
In-reply-to: <1330012913-13293-6-git-send-email-blogic@openwrt.org>
References: <1330012913-13293-1-git-send-email-blogic@openwrt.org> <1330012913-13293-6-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:01, John Crispin wrote:

ltq_gpio_request() now uses devres to manage the gpios. We need to pass a
struct device pointer to make it work.

Signed-off-by: John Crispin<blogic@openwrt.org>
---
  arch/mips/lantiq/xway/gpio_stp.c |   13 ++++++++-----
  1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/arch/mips/lantiq/xway/gpio_stp.c b/arch/mips/lantiq/xway/gpio_stp.c
index cb6f170..e6b4809 100644
--- a/arch/mips/lantiq/xway/gpio_stp.c
+++ b/arch/mips/lantiq/xway/gpio_stp.c
@@ -80,11 +80,6 @@ static struct gpio_chip ltq_stp_chip = {

  static int ltq_stp_hw_init(void)
  {
-       /* the 3 pins used to control the external stp */
-       ltq_gpio_request(4, 2, 1, "stp-st");
-       ltq_gpio_request(5, 2, 1, "stp-d");
-       ltq_gpio_request(6, 2, 1, "stp-sh");
-
        /* sane defaults */
        ltq_stp_w32(0, LTQ_STP_AR);
        ltq_stp_w32(0, LTQ_STP_CPU0);
@@ -133,6 +128,14 @@ static int __devinit ltq_stp_probe(struct platform_device 
*pdev)
                dev_err(&pdev->dev, "failed to remap STP memory\n");
                return -ENOMEM;
        }
+
+       /* the 3 pins used to control the external stp */
+       if (ltq_gpio_request(&pdev->dev, 4, 2, 1, "stp-st") ||
+                       ltq_gpio_request(&pdev->dev, 5, 2, 1, "stp-d") ||
+                       ltq_gpio_request(&pdev->dev, 6, 2, 1, "stp-sh")) {

   This needs to be merged to patch 1...

WBR, Sergei

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