X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=target%2Flinux%2Fath79%2Ffiles%2Fdrivers%2Fmtd%2Fnand%2Fraw%2Fnand_rb4xx.c;fp=target%2Flinux%2Fath79%2Ffiles%2Fdrivers%2Fmtd%2Fnand%2Fraw%2Fnand_rb4xx.c;h=50bd69f6a410d465f1ab0963ca87607e416452e1;hb=2aa558c49a12c0820fd7b6cc55bf90b320ef3551;hp=382af09978a55309eb9b39ab696f394a27c714a2;hpb=ac5671f46cb4a300e2a8ae00db70c248828367f5;p=openwrt%2Fopenwrt.git diff --git a/target/linux/ath79/files/drivers/mtd/nand/raw/nand_rb4xx.c b/target/linux/ath79/files/drivers/mtd/nand/raw/nand_rb4xx.c index 382af09978..50bd69f6a4 100644 --- a/target/linux/ath79/files/drivers/mtd/nand/raw/nand_rb4xx.c +++ b/target/linux/ath79/files/drivers/mtd/nand/raw/nand_rb4xx.c @@ -81,15 +81,9 @@ static const struct mtd_ooblayout_ops rb4xx_nand_ecclayout_ops = { .free = rb4xx_ooblayout_free, }; -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,20,0) -static uint8_t rb4xx_nand_read_byte(struct mtd_info *mtd) -{ - struct rb4xx_nand *nand = mtd->priv; -#else static u8 rb4xx_nand_read_byte(struct nand_chip *chip) { struct rb4xx_nand *nand = chip->priv; -#endif struct rb4xx_cpld *cpld = nand->cpld; u8 data; int ret; @@ -101,45 +95,26 @@ static u8 rb4xx_nand_read_byte(struct nand_chip *chip) return data; } -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,20,0) -static void rb4xx_nand_write_buf(struct mtd_info *mtd, const uint8_t *buf, - int len) -{ - struct rb4xx_nand *nand = mtd->priv; -#else static void rb4xx_nand_write_buf(struct nand_chip *chip, const u8 *buf, int len) { struct rb4xx_nand *nand = chip->priv; -#endif struct rb4xx_cpld *cpld = nand->cpld; cpld->write_nand(cpld, buf, len); } -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,20,0) -static void rb4xx_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) -{ - struct rb4xx_nand *nand = mtd->priv; -#else static void rb4xx_nand_read_buf(struct nand_chip *chip, u8 *buf, int len) { struct rb4xx_nand *nand = chip->priv; -#endif struct rb4xx_cpld *cpld = nand->cpld; cpld->read_nand(cpld, buf, len); } -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,20,0) -static void rb4xx_nand_cmd_ctrl(struct mtd_info *mtd, int dat, unsigned int ctrl) -{ - struct rb4xx_nand *nand = mtd->priv; -#else static void rb4xx_nand_cmd_ctrl(struct nand_chip *chip, int dat, unsigned int ctrl) { struct rb4xx_nand *nand = chip->priv; -#endif struct rb4xx_cpld *cpld = nand->cpld; u8 data = dat; @@ -153,15 +128,9 @@ static void rb4xx_nand_cmd_ctrl(struct nand_chip *chip, int dat, cpld->write_nand(cpld, &data, 1); } -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,20,0) -static int rb4xx_nand_dev_ready(struct mtd_info *mtd) -{ - struct rb4xx_nand *nand = mtd->priv; -#else static int rb4xx_nand_dev_ready(struct nand_chip *chip) { struct rb4xx_nand *nand = chip->priv; -#endif return gpiod_get_value_cansleep(nand->rdy); } @@ -224,20 +193,6 @@ static int rb4xx_nand_probe(struct platform_device *pdev) nand->chip.options = NAND_NO_SUBPAGE_WRITE; nand->chip.priv = nand; -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,20,0) - nand->chip.read_byte = rb4xx_nand_read_byte; - nand->chip.write_buf = rb4xx_nand_write_buf; - nand->chip.read_buf = rb4xx_nand_read_buf; - nand->chip.cmd_ctrl = rb4xx_nand_cmd_ctrl; - nand->chip.dev_ready = rb4xx_nand_dev_ready; - nand->chip.chip_delay = 25; - -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,19,130) - ret = nand_scan(mtd, 1); -#else - ret = nand_scan(&nand->chip, 1); -#endif -#else nand->chip.legacy.read_byte = rb4xx_nand_read_byte; nand->chip.legacy.write_buf = rb4xx_nand_write_buf; nand->chip.legacy.read_buf = rb4xx_nand_read_buf; @@ -246,7 +201,6 @@ static int rb4xx_nand_probe(struct platform_device *pdev) nand->chip.legacy.chip_delay = 25; ret = nand_scan(&nand->chip, 1); -#endif if (ret) return -ENXIO;