kernel: Update kernel 4.19 to version 4.19.131
[openwrt/openwrt.git] / target / linux / ath79 / files / drivers / mtd / nand / raw / nand_rb4xx.c
index 922d7095cb6348cc518b3450288fc48d8c521019..382af09978a55309eb9b39ab696f394a27c714a2 100644 (file)
@@ -232,7 +232,11 @@ static int rb4xx_nand_probe(struct platform_device *pdev)
        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;
@@ -248,11 +252,7 @@ static int rb4xx_nand_probe(struct platform_device *pdev)
 
        ret = mtd_device_register(mtd, NULL, 0);
        if (ret) {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,20,0)
-               nand_release(mtd);
-#else
                nand_release(&nand->chip);
-#endif
                return ret;
        }
 
@@ -263,11 +263,7 @@ static int rb4xx_nand_remove(struct platform_device *pdev)
 {
        struct rb4xx_nand *nand = platform_get_drvdata(pdev);
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,20,0)
-       nand_release(nand_to_mtd(&nand->chip));
-#else
        nand_release(&nand->chip);
-#endif
 
        return 0;
 }