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
@@ -45,12 +45,12 @@ static void orion_nand_cmd_ctrl(struct nand_chip *nc, int cmd,
|
||||
if (nc->options & NAND_BUSWIDTH_16)
|
||||
offs <<= 1;
|
||||
|
||||
writeb(cmd, nc->IO_ADDR_W + offs);
|
||||
writeb(cmd, nc->legacy.IO_ADDR_W + offs);
|
||||
}
|
||||
|
||||
static void orion_nand_read_buf(struct nand_chip *chip, uint8_t *buf, int len)
|
||||
{
|
||||
void __iomem *io_base = chip->IO_ADDR_R;
|
||||
void __iomem *io_base = chip->legacy.IO_ADDR_R;
|
||||
#if defined(__LINUX_ARM_ARCH__) && __LINUX_ARM_ARCH__ >= 5
|
||||
uint64_t *buf64;
|
||||
#endif
|
||||
@@ -136,7 +136,7 @@ static int __init orion_nand_probe(struct platform_device *pdev)
|
||||
|
||||
nand_set_controller_data(nc, board);
|
||||
nand_set_flash_node(nc, pdev->dev.of_node);
|
||||
nc->IO_ADDR_R = nc->IO_ADDR_W = io_base;
|
||||
nc->legacy.IO_ADDR_R = nc->legacy.IO_ADDR_W = io_base;
|
||||
nc->cmd_ctrl = orion_nand_cmd_ctrl;
|
||||
nc->read_buf = orion_nand_read_buf;
|
||||
nc->ecc.mode = NAND_ECC_SOFT;
|
||||
|
||||
Reference in New Issue
Block a user