All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shawn Guo <shawn.guo@linaro.org>
To: linux-arm-kernel@lists.infradead.org
Cc: Olof Johansson <olof@lixom.net>,
	Artem Bityutskiy <artem.bityutskiy@linux.intel.com>,
	Shawn Guo <shawn.guo@linaro.org>,
	linux-mtd@lists.infradead.org, Arnd Bergmann <arnd@arndb.de>
Subject: [PATCH RESEND 5/9] mtd: nand: gpmi: adopt pinctrl support
Date: Mon,  7 May 2012 09:16:10 +0800	[thread overview]
Message-ID: <1336353374-28939-6-git-send-email-shawn.guo@linaro.org> (raw)
In-Reply-To: <1336353374-28939-1-git-send-email-shawn.guo@linaro.org>

Cc: linux-mtd@lists.infradead.org
Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 drivers/mtd/nand/gpmi-nand/gpmi-nand.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index 9ec51ce..8478fd9 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -24,6 +24,7 @@
 #include <linux/module.h>
 #include <linux/mtd/gpmi-nand.h>
 #include <linux/mtd/partitions.h>
+#include <linux/pinctrl/consumer.h>
 #include "gpmi-nand.h"
 
 /* add our owner bbt descriptor */
@@ -476,6 +477,7 @@ acquire_err:
 static int __devinit acquire_resources(struct gpmi_nand_data *this)
 {
 	struct resources *res = &this->resources;
+	struct pinctrl *pinctrl;
 	int ret;
 
 	ret = acquire_register_block(this, GPMI_NAND_GPMI_REGS_ADDR_RES_NAME);
@@ -494,6 +496,12 @@ static int __devinit acquire_resources(struct gpmi_nand_data *this)
 	if (ret)
 		goto exit_dma_channels;
 
+	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+	if (IS_ERR(pinctrl)) {
+		ret = PTR_ERR(pinctrl);
+		goto exit_pin;
+	}
+
 	res->clock = clk_get(&this->pdev->dev, NULL);
 	if (IS_ERR(res->clock)) {
 		pr_err("can not get the clock\n");
@@ -503,6 +511,7 @@ static int __devinit acquire_resources(struct gpmi_nand_data *this)
 	return 0;
 
 exit_clock:
+exit_pin:
 	release_dma_channels(this);
 exit_dma_channels:
 	release_bch_irq(this);
-- 
1.7.5.4

WARNING: multiple messages have this Message-ID (diff)
From: shawn.guo@linaro.org (Shawn Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RESEND 5/9] mtd: nand: gpmi: adopt pinctrl support
Date: Mon,  7 May 2012 09:16:10 +0800	[thread overview]
Message-ID: <1336353374-28939-6-git-send-email-shawn.guo@linaro.org> (raw)
In-Reply-To: <1336353374-28939-1-git-send-email-shawn.guo@linaro.org>

Cc: linux-mtd at lists.infradead.org
Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 drivers/mtd/nand/gpmi-nand/gpmi-nand.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index 9ec51ce..8478fd9 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -24,6 +24,7 @@
 #include <linux/module.h>
 #include <linux/mtd/gpmi-nand.h>
 #include <linux/mtd/partitions.h>
+#include <linux/pinctrl/consumer.h>
 #include "gpmi-nand.h"
 
 /* add our owner bbt descriptor */
@@ -476,6 +477,7 @@ acquire_err:
 static int __devinit acquire_resources(struct gpmi_nand_data *this)
 {
 	struct resources *res = &this->resources;
+	struct pinctrl *pinctrl;
 	int ret;
 
 	ret = acquire_register_block(this, GPMI_NAND_GPMI_REGS_ADDR_RES_NAME);
@@ -494,6 +496,12 @@ static int __devinit acquire_resources(struct gpmi_nand_data *this)
 	if (ret)
 		goto exit_dma_channels;
 
+	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+	if (IS_ERR(pinctrl)) {
+		ret = PTR_ERR(pinctrl);
+		goto exit_pin;
+	}
+
 	res->clock = clk_get(&this->pdev->dev, NULL);
 	if (IS_ERR(res->clock)) {
 		pr_err("can not get the clock\n");
@@ -503,6 +511,7 @@ static int __devinit acquire_resources(struct gpmi_nand_data *this)
 	return 0;
 
 exit_clock:
+exit_pin:
 	release_dma_channels(this);
 exit_dma_channels:
 	release_bch_irq(this);
-- 
1.7.5.4

  parent reply	other threads:[~2012-05-07  1:16 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-07  1:16 [PATCH RESEND 0/9] Enable pinctrl support for mach-mxs Shawn Guo
2012-05-07  1:16 ` Shawn Guo
2012-05-07  1:16 ` Shawn Guo
2012-05-07  1:16 ` Shawn Guo
2012-05-07  1:16 ` [PATCH RESEND 1/9] ARM: mxs: enable pinctrl dummy states Shawn Guo
2012-05-07  1:16 ` [PATCH RESEND 2/9] serial: amba-pl011: adopt pinctrl support Shawn Guo
2012-05-07  1:16   ` Shawn Guo
2012-05-07  1:16 ` [PATCH RESEND 3/9] serial: mxs-auart: " Shawn Guo
2012-05-07  1:16   ` Shawn Guo
2012-05-07  1:16 ` [PATCH RESEND 4/9] mmc: mxs-mmc: " Shawn Guo
2012-05-07  1:16   ` Shawn Guo
2012-05-07  1:16 ` Shawn Guo [this message]
2012-05-07  1:16   ` [PATCH RESEND 5/9] mtd: nand: gpmi: " Shawn Guo
     [not found] ` <1336353374-28939-1-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2012-05-07  1:16   ` [PATCH RESEND 6/9] i2c: mxs: " Shawn Guo
2012-05-07  1:16     ` Shawn Guo
2012-05-07  1:16 ` [PATCH RESEND 7/9] ASoC: mxs-saif: " Shawn Guo
2012-05-07  1:16   ` Shawn Guo
2012-05-07 12:04   ` Mark Brown
2012-05-07 12:04     ` Mark Brown
2012-05-07  1:16 ` [PATCH RESEND 8/9] video: mxsfb: " Shawn Guo
2012-05-07  1:16   ` Shawn Guo
2012-05-07  1:16 ` [PATCH RESEND 9/9] ARM: mxs: enable " Shawn Guo
2012-05-07  7:14 ` [alsa-devel] [PATCH RESEND 0/9] Enable pinctrl support for mach-mxs Dong Aisheng
2012-05-07  7:14   ` Dong Aisheng
2012-05-07  7:14   ` Dong Aisheng
2012-05-07  7:14   ` Dong Aisheng
2012-05-07  7:47   ` Shawn Guo
2012-05-07  7:47     ` Shawn Guo
2012-05-07  7:47     ` Shawn Guo
2012-05-07  7:47     ` Shawn Guo
2012-05-07  7:56     ` Dong Aisheng
2012-05-07  8:01       ` Dong Aisheng
2012-05-07  8:01       ` Dong Aisheng
2012-05-07  8:01       ` Dong Aisheng

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=1336353374-28939-6-git-send-email-shawn.guo@linaro.org \
    --to=shawn.guo@linaro.org \
    --cc=arnd@arndb.de \
    --cc=artem.bityutskiy@linux.intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=olof@lixom.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.