mtd: rawnand: Create a legacy struct and move ->IO_ADDR_{R, W} there
We regularly have new NAND controller drivers that are making use of fields/hooks that we want to get rid of but can't because of all the legacy drivers that we might break if we do. So, instead of removing those fields/hooks, let's move them to a sub-struct which is clearly documented as deprecated. We start with the ->IO_ADDR_{R,W] fields. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
This commit is contained in:

committed by
Miquel Raynal

parent
4ae9402517
commit
82fc509974
@@ -200,7 +200,7 @@ static struct i2c_board_info db1200_i2c_devs[] __initdata = {
|
||||
static void au1200_nand_cmd_ctrl(struct nand_chip *this, int cmd,
|
||||
unsigned int ctrl)
|
||||
{
|
||||
unsigned long ioaddr = (unsigned long)this->IO_ADDR_W;
|
||||
unsigned long ioaddr = (unsigned long)this->legacy.IO_ADDR_W;
|
||||
|
||||
ioaddr &= 0xffffff00;
|
||||
|
||||
@@ -212,9 +212,9 @@ static void au1200_nand_cmd_ctrl(struct nand_chip *this, int cmd,
|
||||
/* assume we want to r/w real data by default */
|
||||
ioaddr += MEM_STNAND_DATA;
|
||||
}
|
||||
this->IO_ADDR_R = this->IO_ADDR_W = (void __iomem *)ioaddr;
|
||||
this->legacy.IO_ADDR_R = this->legacy.IO_ADDR_W = (void __iomem *)ioaddr;
|
||||
if (cmd != NAND_CMD_NONE) {
|
||||
__raw_writeb(cmd, this->IO_ADDR_W);
|
||||
__raw_writeb(cmd, this->legacy.IO_ADDR_W);
|
||||
wmb();
|
||||
}
|
||||
}
|
||||
|
@@ -152,7 +152,7 @@ static void __init db1300_gpio_config(void)
|
||||
static void au1300_nand_cmd_ctrl(struct nand_chip *this, int cmd,
|
||||
unsigned int ctrl)
|
||||
{
|
||||
unsigned long ioaddr = (unsigned long)this->IO_ADDR_W;
|
||||
unsigned long ioaddr = (unsigned long)this->legacy.IO_ADDR_W;
|
||||
|
||||
ioaddr &= 0xffffff00;
|
||||
|
||||
@@ -164,9 +164,9 @@ static void au1300_nand_cmd_ctrl(struct nand_chip *this, int cmd,
|
||||
/* assume we want to r/w real data by default */
|
||||
ioaddr += MEM_STNAND_DATA;
|
||||
}
|
||||
this->IO_ADDR_R = this->IO_ADDR_W = (void __iomem *)ioaddr;
|
||||
this->legacy.IO_ADDR_R = this->legacy.IO_ADDR_W = (void __iomem *)ioaddr;
|
||||
if (cmd != NAND_CMD_NONE) {
|
||||
__raw_writeb(cmd, this->IO_ADDR_W);
|
||||
__raw_writeb(cmd, this->legacy.IO_ADDR_W);
|
||||
wmb();
|
||||
}
|
||||
}
|
||||
|
@@ -129,7 +129,7 @@ static struct i2c_board_info db1550_i2c_devs[] __initdata = {
|
||||
static void au1550_nand_cmd_ctrl(struct nand_chip *this, int cmd,
|
||||
unsigned int ctrl)
|
||||
{
|
||||
unsigned long ioaddr = (unsigned long)this->IO_ADDR_W;
|
||||
unsigned long ioaddr = (unsigned long)this->legacy.IO_ADDR_W;
|
||||
|
||||
ioaddr &= 0xffffff00;
|
||||
|
||||
@@ -141,9 +141,9 @@ static void au1550_nand_cmd_ctrl(struct nand_chip *this, int cmd,
|
||||
/* assume we want to r/w real data by default */
|
||||
ioaddr += MEM_STNAND_DATA;
|
||||
}
|
||||
this->IO_ADDR_R = this->IO_ADDR_W = (void __iomem *)ioaddr;
|
||||
this->legacy.IO_ADDR_R = this->legacy.IO_ADDR_W = (void __iomem *)ioaddr;
|
||||
if (cmd != NAND_CMD_NONE) {
|
||||
__raw_writeb(cmd, this->IO_ADDR_W);
|
||||
__raw_writeb(cmd, this->legacy.IO_ADDR_W);
|
||||
wmb();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user