Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 332656
b: refs/heads/master
c: df63fe7
h: refs/heads/master
v: v3
  • Loading branch information
Alexandre Pereira da Silva authored and David Woodhouse committed Jul 6, 2012
1 parent c3af622 commit f8b77ea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1c7b874d33b463f7150b1ab4617f000af9b327fd
refs/heads/master: df63fe7657d75424f58b41ac079ed8bc4b4676fb
11 changes: 7 additions & 4 deletions trunk/drivers/mtd/nand/lpc32xx_slc.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ struct lpc32xx_nand_cfg_slc {
uint32_t rhold;
uint32_t rsetup;
bool use_bbt;
unsigned wp_gpio;
int wp_gpio;
struct mtd_partition *parts;
unsigned num_parts;
};
Expand Down Expand Up @@ -295,15 +295,17 @@ static int lpc32xx_nand_device_ready(struct mtd_info *mtd)
*/
static void lpc32xx_wp_enable(struct lpc32xx_nand_host *host)
{
gpio_set_value(host->ncfg->wp_gpio, 0);
if (gpio_is_valid(host->ncfg->wp_gpio))
gpio_set_value(host->ncfg->wp_gpio, 0);
}

/*
* Disable NAND write protect
*/
static void lpc32xx_wp_disable(struct lpc32xx_nand_host *host)
{
gpio_set_value(host->ncfg->wp_gpio, 1);
if (gpio_is_valid(host->ncfg->wp_gpio))
gpio_set_value(host->ncfg->wp_gpio, 1);
}

/*
Expand Down Expand Up @@ -819,7 +821,8 @@ static int __devinit lpc32xx_nand_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "Missing platform data\n");
return -ENOENT;
}
if (gpio_request(host->ncfg->wp_gpio, "NAND WP")) {
if (gpio_is_valid(host->ncfg->wp_gpio) &&
gpio_request(host->ncfg->wp_gpio, "NAND WP")) {
dev_err(&pdev->dev, "GPIO not available\n");
return -EBUSY;
}
Expand Down

0 comments on commit f8b77ea

Please sign in to comment.