Received: from smtp27.mail.ru ([94.100.176.180]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1USs3I-0003oW-63 for linux-mtd@lists.infradead.org; Thu, 18 Apr 2013 16:51:21 +0000 From: Alexander Shiyan To: linux-mtd@lists.infradead.org Subject: [PATCH RESEND 4/5] mtd: nand-gpio: Use default nand_base {read/write}_buf functions Date: Thu, 18 Apr 2013 20:50:45 +0400 Message-Id: <1366303846-20384-5-git-send-email-shc_work@mail.ru> In-Reply-To: <1366303846-20384-1-git-send-email-shc_work@mail.ru> References: <1366303846-20384-1-git-send-email-shc_work@mail.ru> Cc: Artem Bityutskiy , Brian Norris , David Woodhouse , Alexander Shiyan List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Signed-off-by: Alexander Shiyan --- drivers/mtd/nand/gpio.c | 55 ------------------------------------------------- 1 file changed, 55 deletions(-) diff --git a/drivers/mtd/nand/gpio.c b/drivers/mtd/nand/gpio.c index 49beecd..16b8eeb 100644 --- a/drivers/mtd/nand/gpio.c +++ b/drivers/mtd/nand/gpio.c @@ -86,51 +86,6 @@ static void gpio_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) gpio_nand_dosync(gpiomtd); } -static void gpio_nand_writebuf(struct mtd_info *mtd, const u_char *buf, int len) -{ - struct nand_chip *this = mtd->priv; - - iowrite8_rep(this->IO_ADDR_W, buf, len); -} - -static void gpio_nand_readbuf(struct mtd_info *mtd, u_char *buf, int len) -{ - struct nand_chip *this = mtd->priv; - - ioread8_rep(this->IO_ADDR_R, buf, len); -} - -static void gpio_nand_writebuf16(struct mtd_info *mtd, const u_char *buf, - int len) -{ - struct nand_chip *this = mtd->priv; - - if (IS_ALIGNED((unsigned long)buf, 2)) { - iowrite16_rep(this->IO_ADDR_W, buf, len>>1); - } else { - int i; - unsigned short *ptr = (unsigned short *)buf; - - for (i = 0; i < len; i += 2, ptr++) - writew(*ptr, this->IO_ADDR_W); - } -} - -static void gpio_nand_readbuf16(struct mtd_info *mtd, u_char *buf, int len) -{ - struct nand_chip *this = mtd->priv; - - if (IS_ALIGNED((unsigned long)buf, 2)) { - ioread16_rep(this->IO_ADDR_R, buf, len>>1); - } else { - int i; - unsigned short *ptr = (unsigned short *)buf; - - for (i = 0; i < len; i += 2, ptr++) - *ptr = readw(this->IO_ADDR_R); - } -} - static int gpio_nand_devready(struct mtd_info *mtd) { struct gpiomtd *gpiomtd = gpio_nand_getpriv(mtd); @@ -303,16 +258,6 @@ static int gpio_nand_probe(struct platform_device *pdev) chip->options = gpiomtd->plat.options; chip->chip_delay = gpiomtd->plat.chip_delay; chip->cmd_ctrl = gpio_nand_cmd_ctrl; - - if (chip->options & NAND_BUSWIDTH_16) { - chip->read_buf = gpio_nand_readbuf16; - chip->write_buf = gpio_nand_writebuf16; - } else { - chip->read_buf = gpio_nand_readbuf; - chip->write_buf = gpio_nand_writebuf; - } - - /* set the mtd private data for the nand driver */ gpiomtd->mtd_info.priv = chip; gpiomtd->mtd_info.owner = THIS_MODULE; -- 1.8.1.5