Commit 5ba8c27a authored by Brian Norris's avatar Brian Norris

Merge arch/{arm,blackfin,cris,mips}/ refactoring patches into MTD dev

These patches may also get merged by other arch/ maintainers, so I've
based them on 4.4-rc1 instead of the latest MTD development. Bring them
in now.
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
static void snappercl15_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, static void snappercl15_nand_cmd_ctrl(struct mtd_info *mtd, int cmd,
unsigned int ctrl) unsigned int ctrl)
{ {
struct nand_chip *chip = mtd->priv; struct nand_chip *chip = mtd_to_nand(mtd);
static u16 nand_state = SNAPPERCL15_NAND_WPN; static u16 nand_state = SNAPPERCL15_NAND_WPN;
u16 set; u16 set;
...@@ -76,7 +76,7 @@ static void snappercl15_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, ...@@ -76,7 +76,7 @@ static void snappercl15_nand_cmd_ctrl(struct mtd_info *mtd, int cmd,
static int snappercl15_nand_dev_ready(struct mtd_info *mtd) static int snappercl15_nand_dev_ready(struct mtd_info *mtd)
{ {
struct nand_chip *chip = mtd->priv; struct nand_chip *chip = mtd_to_nand(mtd);
return !!(__raw_readw(NAND_CTRL_ADDR(chip)) & SNAPPERCL15_NAND_RDY); return !!(__raw_readw(NAND_CTRL_ADDR(chip)) & SNAPPERCL15_NAND_RDY);
} }
......
...@@ -74,7 +74,7 @@ static void __init ts72xx_map_io(void) ...@@ -74,7 +74,7 @@ static void __init ts72xx_map_io(void)
static void ts72xx_nand_hwcontrol(struct mtd_info *mtd, static void ts72xx_nand_hwcontrol(struct mtd_info *mtd,
int cmd, unsigned int ctrl) int cmd, unsigned int ctrl)
{ {
struct nand_chip *chip = mtd->priv; struct nand_chip *chip = mtd_to_nand(mtd);
if (ctrl & NAND_CTRL_CHANGE) { if (ctrl & NAND_CTRL_CHANGE) {
void __iomem *addr = chip->IO_ADDR_R; void __iomem *addr = chip->IO_ADDR_R;
...@@ -96,7 +96,7 @@ static void ts72xx_nand_hwcontrol(struct mtd_info *mtd, ...@@ -96,7 +96,7 @@ static void ts72xx_nand_hwcontrol(struct mtd_info *mtd,
static int ts72xx_nand_device_ready(struct mtd_info *mtd) static int ts72xx_nand_device_ready(struct mtd_info *mtd)
{ {
struct nand_chip *chip = mtd->priv; struct nand_chip *chip = mtd_to_nand(mtd);
void __iomem *addr = chip->IO_ADDR_R; void __iomem *addr = chip->IO_ADDR_R;
addr += (1 << TS72XX_NAND_BUSY_ADDR_LINE); addr += (1 << TS72XX_NAND_BUSY_ADDR_LINE);
......
...@@ -131,7 +131,7 @@ static void qong_init_nor_mtd(void) ...@@ -131,7 +131,7 @@ static void qong_init_nor_mtd(void)
*/ */
static void qong_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) static void qong_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
{ {
struct nand_chip *nand_chip = mtd->priv; struct nand_chip *nand_chip = mtd_to_nand(mtd);
if (cmd == NAND_CMD_NONE) if (cmd == NAND_CMD_NONE)
return; return;
......
...@@ -76,7 +76,7 @@ static struct mtd_partition ixdp425_partitions[] = { ...@@ -76,7 +76,7 @@ static struct mtd_partition ixdp425_partitions[] = {
static void static void
ixdp425_flash_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) ixdp425_flash_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
{ {
struct nand_chip *this = mtd->priv; struct nand_chip *this = mtd_to_nand(mtd);
int offset = (int)this->priv; int offset = (int)this->priv;
if (ctrl & NAND_CTRL_CHANGE) { if (ctrl & NAND_CTRL_CHANGE) {
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
void omap1_nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl) void omap1_nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
{ {
struct nand_chip *this = mtd->priv; struct nand_chip *this = mtd_to_nand(mtd);
unsigned long mask; unsigned long mask;
if (cmd == NAND_CMD_NONE) if (cmd == NAND_CMD_NONE)
......
...@@ -176,7 +176,7 @@ static void ts78xx_ts_rtc_unload(void) ...@@ -176,7 +176,7 @@ static void ts78xx_ts_rtc_unload(void)
static void ts78xx_ts_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, static void ts78xx_ts_nand_cmd_ctrl(struct mtd_info *mtd, int cmd,
unsigned int ctrl) unsigned int ctrl)
{ {
struct nand_chip *this = mtd->priv; struct nand_chip *this = mtd_to_nand(mtd);
if (ctrl & NAND_CTRL_CHANGE) { if (ctrl & NAND_CTRL_CHANGE) {
unsigned char bits; unsigned char bits;
...@@ -200,7 +200,7 @@ static int ts78xx_ts_nand_dev_ready(struct mtd_info *mtd) ...@@ -200,7 +200,7 @@ static int ts78xx_ts_nand_dev_ready(struct mtd_info *mtd)
static void ts78xx_ts_nand_write_buf(struct mtd_info *mtd, static void ts78xx_ts_nand_write_buf(struct mtd_info *mtd,
const uint8_t *buf, int len) const uint8_t *buf, int len)
{ {
struct nand_chip *chip = mtd->priv; struct nand_chip *chip = mtd_to_nand(mtd);
void __iomem *io_base = chip->IO_ADDR_W; void __iomem *io_base = chip->IO_ADDR_W;
unsigned long off = ((unsigned long)buf & 3); unsigned long off = ((unsigned long)buf & 3);
int sz; int sz;
...@@ -227,7 +227,7 @@ static void ts78xx_ts_nand_write_buf(struct mtd_info *mtd, ...@@ -227,7 +227,7 @@ static void ts78xx_ts_nand_write_buf(struct mtd_info *mtd,
static void ts78xx_ts_nand_read_buf(struct mtd_info *mtd, static void ts78xx_ts_nand_read_buf(struct mtd_info *mtd,
uint8_t *buf, int len) uint8_t *buf, int len)
{ {
struct nand_chip *chip = mtd->priv; struct nand_chip *chip = mtd_to_nand(mtd);
void __iomem *io_base = chip->IO_ADDR_R; void __iomem *io_base = chip->IO_ADDR_R;
unsigned long off = ((unsigned long)buf & 3); unsigned long off = ((unsigned long)buf & 3);
int sz; int sz;
......
...@@ -572,7 +572,7 @@ static inline void balloon3_i2c_init(void) {} ...@@ -572,7 +572,7 @@ static inline void balloon3_i2c_init(void) {}
#if defined(CONFIG_MTD_NAND_PLATFORM)||defined(CONFIG_MTD_NAND_PLATFORM_MODULE) #if defined(CONFIG_MTD_NAND_PLATFORM)||defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
static void balloon3_nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl) static void balloon3_nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
{ {
struct nand_chip *this = mtd->priv; struct nand_chip *this = mtd_to_nand(mtd);
uint8_t balloon3_ctl_set = 0, balloon3_ctl_clr = 0; uint8_t balloon3_ctl_set = 0, balloon3_ctl_clr = 0;
if (ctrl & NAND_CTRL_CHANGE) { if (ctrl & NAND_CTRL_CHANGE) {
......
...@@ -289,7 +289,7 @@ static void nand_cs_off(void) ...@@ -289,7 +289,7 @@ static void nand_cs_off(void)
static void em_x270_nand_cmd_ctl(struct mtd_info *mtd, int dat, static void em_x270_nand_cmd_ctl(struct mtd_info *mtd, int dat,
unsigned int ctrl) unsigned int ctrl)
{ {
struct nand_chip *this = mtd->priv; struct nand_chip *this = mtd_to_nand(mtd);
unsigned long nandaddr = (unsigned long)this->IO_ADDR_W; unsigned long nandaddr = (unsigned long)this->IO_ADDR_W;
dsb(); dsb();
......
...@@ -250,7 +250,7 @@ static inline void palmtx_keys_init(void) {} ...@@ -250,7 +250,7 @@ static inline void palmtx_keys_init(void) {}
static void palmtx_nand_cmd_ctl(struct mtd_info *mtd, int cmd, static void palmtx_nand_cmd_ctl(struct mtd_info *mtd, int cmd,
unsigned int ctrl) unsigned int ctrl)
{ {
struct nand_chip *this = mtd->priv; struct nand_chip *this = mtd_to_nand(mtd);
char __iomem *nandaddr = this->IO_ADDR_W; char __iomem *nandaddr = this->IO_ADDR_W;
if (cmd == NAND_CMD_NONE) if (cmd == NAND_CMD_NONE)
......
...@@ -404,7 +404,7 @@ static struct mtd_partition bfin_plat_nand_partitions[] = { ...@@ -404,7 +404,7 @@ static struct mtd_partition bfin_plat_nand_partitions[] = {
#define BFIN_NAND_PLAT_ALE 1 #define BFIN_NAND_PLAT_ALE 1
static void bfin_plat_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) static void bfin_plat_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
{ {
struct nand_chip *this = mtd->priv; struct nand_chip *this = mtd_to_nand(mtd);
if (cmd == NAND_CMD_NONE) if (cmd == NAND_CMD_NONE)
return; return;
......
...@@ -267,7 +267,7 @@ static struct mtd_partition bfin_plat_nand_partitions[] = { ...@@ -267,7 +267,7 @@ static struct mtd_partition bfin_plat_nand_partitions[] = {
static void bfin_plat_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, static void bfin_plat_nand_cmd_ctrl(struct mtd_info *mtd, int cmd,
unsigned int ctrl) unsigned int ctrl)
{ {
struct nand_chip *this = mtd->priv; struct nand_chip *this = mtd_to_nand(mtd);
if (cmd == NAND_CMD_NONE) if (cmd == NAND_CMD_NONE)
return; return;
......
...@@ -52,7 +52,7 @@ static void crisv32_hwcontrol(struct mtd_info *mtd, int cmd, ...@@ -52,7 +52,7 @@ static void crisv32_hwcontrol(struct mtd_info *mtd, int cmd,
{ {
unsigned long flags; unsigned long flags;
reg_pio_rw_dout dout; reg_pio_rw_dout dout;
struct nand_chip *this = mtd->priv; struct nand_chip *this = mtd_to_nand(mtd);
local_irq_save(flags); local_irq_save(flags);
......
...@@ -51,7 +51,7 @@ static void crisv32_hwcontrol(struct mtd_info *mtd, int cmd, ...@@ -51,7 +51,7 @@ static void crisv32_hwcontrol(struct mtd_info *mtd, int cmd,
{ {
unsigned long flags; unsigned long flags;
reg_gio_rw_pa_dout dout; reg_gio_rw_pa_dout dout;
struct nand_chip *this = mtd->priv; struct nand_chip *this = mtd_to_nand(mtd);
local_irq_save(flags); local_irq_save(flags);
......
...@@ -200,7 +200,7 @@ static struct i2c_board_info db1200_i2c_devs[] __initdata = { ...@@ -200,7 +200,7 @@ static struct i2c_board_info db1200_i2c_devs[] __initdata = {
static void au1200_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, static void au1200_nand_cmd_ctrl(struct mtd_info *mtd, int cmd,
unsigned int ctrl) unsigned int ctrl)
{ {
struct nand_chip *this = mtd->priv; struct nand_chip *this = mtd_to_nand(mtd);
unsigned long ioaddr = (unsigned long)this->IO_ADDR_W; unsigned long ioaddr = (unsigned long)this->IO_ADDR_W;
ioaddr &= 0xffffff00; ioaddr &= 0xffffff00;
......
...@@ -150,7 +150,7 @@ static void __init db1300_gpio_config(void) ...@@ -150,7 +150,7 @@ static void __init db1300_gpio_config(void)
static void au1300_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, static void au1300_nand_cmd_ctrl(struct mtd_info *mtd, int cmd,
unsigned int ctrl) unsigned int ctrl)
{ {
struct nand_chip *this = mtd->priv; struct nand_chip *this = mtd_to_nand(mtd);
unsigned long ioaddr = (unsigned long)this->IO_ADDR_W; unsigned long ioaddr = (unsigned long)this->IO_ADDR_W;
ioaddr &= 0xffffff00; ioaddr &= 0xffffff00;
......
...@@ -128,7 +128,7 @@ static struct i2c_board_info db1550_i2c_devs[] __initdata = { ...@@ -128,7 +128,7 @@ static struct i2c_board_info db1550_i2c_devs[] __initdata = {
static void au1550_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, static void au1550_nand_cmd_ctrl(struct mtd_info *mtd, int cmd,
unsigned int ctrl) unsigned int ctrl)
{ {
struct nand_chip *this = mtd->priv; struct nand_chip *this = mtd_to_nand(mtd);
unsigned long ioaddr = (unsigned long)this->IO_ADDR_W; unsigned long ioaddr = (unsigned long)this->IO_ADDR_W;
ioaddr &= 0xffffff00; ioaddr &= 0xffffff00;
......
...@@ -180,7 +180,7 @@ static struct platform_device pnx833x_sata_device = { ...@@ -180,7 +180,7 @@ static struct platform_device pnx833x_sata_device = {
static void static void
pnx833x_flash_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) pnx833x_flash_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
{ {
struct nand_chip *this = mtd->priv; struct nand_chip *this = mtd_to_nand(mtd);
unsigned long nandaddr = (unsigned long)this->IO_ADDR_W; unsigned long nandaddr = (unsigned long)this->IO_ADDR_W;
if (cmd == NAND_CMD_NONE) if (cmd == NAND_CMD_NONE)
......
...@@ -148,7 +148,7 @@ static int rb532_dev_ready(struct mtd_info *mtd) ...@@ -148,7 +148,7 @@ static int rb532_dev_ready(struct mtd_info *mtd)
static void rb532_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) static void rb532_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
{ {
struct nand_chip *chip = mtd->priv; struct nand_chip *chip = mtd_to_nand(mtd);
unsigned char orbits, nandbits; unsigned char orbits, nandbits;
if (ctrl & NAND_CTRL_CHANGE) { if (ctrl & NAND_CTRL_CHANGE) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment