summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorKevin Hilman <khilman@linaro.org>2013-10-18 11:30:16 -0700
committerKevin Hilman <khilman@linaro.org>2013-10-18 11:30:37 -0700
commitee4383e0c1e3285b3a8b47c801b2941166f035c3 (patch)
treea197edf4fadbc468ba7001e74cfd340c327f6a22 /drivers/mtd
parentaf43ef6770560103dc10daa9caa31688e4ed7e4c (diff)
parent06ff74fd197aa8205443cf64b94383802602e320 (diff)
Merge tag 'omap-for-v3.13/board-removal-signed-take2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/dt
From Tony Lindgren: Changes needed to drop legacy booting support for some omap3 boards. Note that that these are based on a merge of the following for the dependencies: - v3.12-rc5 for fixes to pinctrl mask - omap-for-v3.13/dt-signed to avoid pointless merge conflicts - omap-for-v3.13/quirk-signed for legacy pdata handling * tag 'omap-for-v3.13/board-removal-signed-take2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: (125 commits) ARM: OMAP2+: remove legacy support for IGEP boards ARM: OMAP2+: Remove legacy support for zoom platforms ARM: OMAP2+: Remove legacy booting support for omap3 EVM ARM: OMAP2: delete board-rm680 ARM: dts: add minimal DT support for Nokia N950 & N9 phones ARM: dts: Add basic support for zoom3 ARM: dts: Add basic support for TMDSEVM3730 (Mistral AM/DM37x EVM) ARM: dts: Add common support for omap3-evm ARM: dts: Shared file for omap GPMC connected smsc911x +Linux 3.12-rc5 Signed-off-by: Kevin Hilman <khilman@linaro.org>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/devices/m25p80.c17
-rw-r--r--drivers/mtd/nand/nand_base.c8
2 files changed, 18 insertions, 7 deletions
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 26b14f9fcac6..6bc9618af094 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -168,12 +168,25 @@ static inline int write_disable(struct m25p *flash)
*/
static inline int set_4byte(struct m25p *flash, u32 jedec_id, int enable)
{
+ int status;
+ bool need_wren = false;
+
switch (JEDEC_MFR(jedec_id)) {
- case CFI_MFR_MACRONIX:
case CFI_MFR_ST: /* Micron, actually */
+ /* Some Micron need WREN command; all will accept it */
+ need_wren = true;
+ case CFI_MFR_MACRONIX:
case 0xEF /* winbond */:
+ if (need_wren)
+ write_enable(flash);
+
flash->command[0] = enable ? OPCODE_EN4B : OPCODE_EX4B;
- return spi_write(flash->spi, flash->command, 1);
+ status = spi_write(flash->spi, flash->command, 1);
+
+ if (need_wren)
+ write_disable(flash);
+
+ return status;
default:
/* Spansion style */
flash->command[0] = OPCODE_BRWR;
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 7ed4841327f2..d340b2f198c6 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2869,10 +2869,8 @@ static int nand_flash_detect_ext_param_page(struct mtd_info *mtd,
len = le16_to_cpu(p->ext_param_page_length) * 16;
ep = kmalloc(len, GFP_KERNEL);
- if (!ep) {
- ret = -ENOMEM;
- goto ext_out;
- }
+ if (!ep)
+ return -ENOMEM;
/* Send our own NAND_CMD_PARAM. */
chip->cmdfunc(mtd, NAND_CMD_PARAM, 0, -1);
@@ -2920,7 +2918,7 @@ static int nand_flash_detect_ext_param_page(struct mtd_info *mtd,
}
pr_info("ONFI extended param page detected.\n");
- return 0;
+ ret = 0;
ext_out:
kfree(ep);