Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MTD: [NAND] Fix the sharpsl driver after breakage from a core conversion

The CNE bits are inverted on the device and writeb function is missing a
NOT operation.

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>

authored by

Richard Purdie and committed by
David Woodhouse
6a5a297c 8b0036ee

+5 -2
+5 -2
drivers/mtd/nand/sharpsl.c
··· 78 78 /* 79 79 * hardware specific access to control-lines 80 80 * ctrl: 81 - * NAND_CNE: bit 0 -> bit 0 & 4 81 + * NAND_CNE: bit 0 -> ! bit 0 & 4 82 82 * NAND_CLE: bit 1 -> bit 1 83 83 * NAND_ALE: bit 2 -> bit 2 84 84 * ··· 92 92 unsigned char bits = ctrl & 0x07; 93 93 94 94 bits |= (ctrl & 0x01) << 4; 95 - writeb((readb(FLASHCTL) & 0x17) | bits, FLASHCTL); 95 + 96 + bits ^= 0x11; 97 + 98 + writeb((readb(FLASHCTL) & ~0x17) | bits, FLASHCTL); 96 99 } 97 100 98 101 if (cmd != NAND_CMD_NONE)