summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Guo2012-05-06 16:57:41 +0200
committerShawn Guo2012-05-12 03:43:16 +0200
commit39febc018bd26edb9f9f73c0f5ee661de37c7869 (patch)
tree241350d8e0defc3c776ca321a626124989283de0
parentmmc: mxs-mmc: adopt pinctrl support (diff)
downloadkernel-qcow2-linux-39febc018bd26edb9f9f73c0f5ee661de37c7869.tar.gz
kernel-qcow2-linux-39febc018bd26edb9f9f73c0f5ee661de37c7869.tar.xz
kernel-qcow2-linux-39febc018bd26edb9f9f73c0f5ee661de37c7869.zip
mtd: nand: gpmi: adopt pinctrl support
Cc: linux-mtd@lists.infradead.org Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
-rw-r--r--drivers/mtd/nand/gpmi-nand/gpmi-nand.c9
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 9ec51cec2e14..8478fd9701a3 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);