diff mbox series

[4/4] mtd: rawnand: cs553x: Get rid of the legacy interface implementation

Message ID 20200501090650.1138200-5-boris.brezillon@collabora.com
State Accepted
Headers show
Series mtd: rawnand: cs553x: Convert to exec_op() | expand

Commit Message

Boris Brezillon May 1, 2020, 9:06 a.m. UTC
Now that exec_op() is implemented we no longer need to implement the
legacy hooks.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 drivers/mtd/nand/raw/cs553x_nand.c | 72 ------------------------------
 1 file changed, 72 deletions(-)

Comments

Miquel Raynal May 8, 2020, 10:20 a.m. UTC | #1
Boris Brezillon <boris.brezillon@collabora.com> wrote on Fri,  1 May
2020 11:06:50 +0200:

> Now that exec_op() is implemented we no longer need to implement the
> legacy hooks.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> ---

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Miquel Raynal May 10, 2020, 8:04 p.m. UTC | #2
On Fri, 2020-05-01 at 09:06:50 UTC, Boris Brezillon wrote:
> Now that exec_op() is implemented we no longer need to implement the
> legacy hooks.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel
diff mbox series

Patch

diff --git a/drivers/mtd/nand/raw/cs553x_nand.c b/drivers/mtd/nand/raw/cs553x_nand.c
index 3596edc6b777..df5e24a2bbd7 100644
--- a/drivers/mtd/nand/raw/cs553x_nand.c
+++ b/drivers/mtd/nand/raw/cs553x_nand.c
@@ -101,70 +101,6 @@  to_cs553x(struct nand_controller *controller)
 	return container_of(controller, struct cs553x_nand_controller, base);
 }
 
-static void cs553x_read_buf(struct nand_chip *this, u_char *buf, int len)
-{
-	struct cs553x_nand_controller *cs553x = to_cs553x(this->controller);
-
-	while (unlikely(len > 0x800)) {
-		memcpy_fromio(buf, cs553x->mmio, 0x800);
-		buf += 0x800;
-		len -= 0x800;
-	}
-	memcpy_fromio(buf, cs553x->mmio, len);
-}
-
-static void cs553x_write_buf(struct nand_chip *this, const u_char *buf, int len)
-{
-	struct cs553x_nand_controller *cs553x = to_cs553x(this->controller);
-
-	while (unlikely(len > 0x800)) {
-		memcpy_toio(cs553x->mmio, buf, 0x800);
-		buf += 0x800;
-		len -= 0x800;
-	}
-	memcpy_toio(cs553x->mmio, buf, len);
-}
-
-static unsigned char cs553x_read_byte(struct nand_chip *this)
-{
-	struct cs553x_nand_controller *cs553x = to_cs553x(this->controller);
-
-	return readb(cs553x->mmio);
-}
-
-static void cs553x_write_byte(struct nand_chip *this, u_char byte)
-{
-	struct cs553x_nand_controller *cs553x = to_cs553x(this->controller);
-	int i = 100000;
-
-	while (i && readb(cs553x->mmio + MM_NAND_STS) & CS_NAND_CTLR_BUSY) {
-		udelay(1);
-		i--;
-	}
-	writeb(byte, cs553x->mmio + 0x801);
-}
-
-static void cs553x_hwcontrol(struct nand_chip *this, int cmd,
-			     unsigned int ctrl)
-{
-	struct cs553x_nand_controller *cs553x = to_cs553x(this->controller);
-
-	if (ctrl & NAND_CTRL_CHANGE) {
-		unsigned char ctl = (ctrl & ~NAND_CTRL_CHANGE ) ^ 0x01;
-		writeb(ctl, cs553x->mmio + MM_NAND_CTL);
-	}
-	if (cmd != NAND_CMD_NONE)
-		cs553x_write_byte(this, cmd);
-}
-
-static int cs553x_device_ready(struct nand_chip *this)
-{
-	struct cs553x_nand_controller *cs553x = to_cs553x(this->controller);
-	unsigned char foo = readb(cs553x->mmio + MM_NAND_STS);
-
-	return (foo & CS_NAND_STS_FLASH_RDY) && !(foo & CS_NAND_CTLR_BUSY);
-}
-
 static int cs553x_write_ctrl_byte(struct cs553x_nand_controller *cs553x,
 				  u32 ctl, u8 data)
 {
@@ -350,14 +286,6 @@  static int __init cs553x_init_one(int cs, int mmio, unsigned long adr)
 		goto out_mtd;
 	}
 
-	this->legacy.cmd_ctrl = cs553x_hwcontrol;
-	this->legacy.dev_ready = cs553x_device_ready;
-	this->legacy.read_byte = cs553x_read_byte;
-	this->legacy.read_buf = cs553x_read_buf;
-	this->legacy.write_buf = cs553x_write_buf;
-
-	this->legacy.chip_delay = 0;
-
 	this->ecc.mode = NAND_ECC_HW;
 	this->ecc.size = 256;
 	this->ecc.bytes = 3;