Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'nand/for-6.4' into mtd/next

Raw NAND core changes:
* Convert to platform remove callback returning void
* Fix spelling mistake waifunc() -> waitfunc()

Raw NAND controller driver changes:
* imx: Remove unused is_imx51_nfc and imx53_nfc functions
* omap2: Drop obsolete dependency on COMPILE_TEST
* orion: Use devm_platform_ioremap_resource()
* qcom:
- Use of_property_present() for testing DT property presence
- Use devm_platform_get_and_ioremap_resource()
* stm32_fmc2: Depends on ARCH_STM32 instead of MACH_STM32MP157
* tmio: Remove reference to config MTD_NAND_TMIO in the parsers

Raw NAND manufacturer driver changes:
* hynix: Fix up bit 0 of sdr_timing_mode

SPI-NAND changes:
* Add support for ESMT F50x1G41LB

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

+258 -212
+2 -4
drivers/mtd/nand/ecc-mxic.c
··· 847 847 return 0; 848 848 } 849 849 850 - static int mxic_ecc_remove(struct platform_device *pdev) 850 + static void mxic_ecc_remove(struct platform_device *pdev) 851 851 { 852 852 struct mxic_ecc_engine *mxic = platform_get_drvdata(pdev); 853 853 854 854 nand_ecc_unregister_on_host_hw_engine(&mxic->external_engine); 855 - 856 - return 0; 857 855 } 858 856 859 857 static const struct of_device_id mxic_ecc_of_ids[] = { ··· 868 870 .of_match_table = mxic_ecc_of_ids, 869 871 }, 870 872 .probe = mxic_ecc_probe, 871 - .remove = mxic_ecc_remove, 873 + .remove_new = mxic_ecc_remove, 872 874 }; 873 875 module_platform_driver(mxic_ecc_driver); 874 876
+1 -1
drivers/mtd/nand/onenand/Kconfig
··· 25 25 config MTD_ONENAND_OMAP2 26 26 tristate "OneNAND on OMAP2/OMAP3 support" 27 27 depends on ARCH_OMAP2 || ARCH_OMAP3 || (COMPILE_TEST && ARM) 28 - depends on OF || COMPILE_TEST 28 + depends on OF 29 29 depends on OMAP_GPMC 30 30 help 31 31 Support for a OneNAND flash device connected to an OMAP2/OMAP3 SoC
+2 -4
drivers/mtd/nand/onenand/generic.c
··· 85 85 return err; 86 86 } 87 87 88 - static int generic_onenand_remove(struct platform_device *pdev) 88 + static void generic_onenand_remove(struct platform_device *pdev) 89 89 { 90 90 struct onenand_info *info = platform_get_drvdata(pdev); 91 91 struct resource *res = pdev->resource; ··· 97 97 iounmap(info->onenand.base); 98 98 kfree(info); 99 99 } 100 - 101 - return 0; 102 100 } 103 101 104 102 static struct platform_driver generic_onenand_driver = { ··· 104 106 .name = DRIVER_NAME, 105 107 }, 106 108 .probe = generic_onenand_probe, 107 - .remove = generic_onenand_remove, 109 + .remove_new = generic_onenand_remove, 108 110 }; 109 111 110 112 module_platform_driver(generic_onenand_driver);
+2 -4
drivers/mtd/nand/onenand/onenand_omap2.c
··· 581 581 return r; 582 582 } 583 583 584 - static int omap2_onenand_remove(struct platform_device *pdev) 584 + static void omap2_onenand_remove(struct platform_device *pdev) 585 585 { 586 586 struct omap2_onenand *c = dev_get_drvdata(&pdev->dev); 587 587 ··· 589 589 if (c->dma_chan) 590 590 dma_release_channel(c->dma_chan); 591 591 omap2_onenand_shutdown(pdev); 592 - 593 - return 0; 594 592 } 595 593 596 594 static const struct of_device_id omap2_onenand_id_table[] = { ··· 599 601 600 602 static struct platform_driver omap2_onenand_driver = { 601 603 .probe = omap2_onenand_probe, 602 - .remove = omap2_onenand_remove, 604 + .remove_new = omap2_onenand_remove, 603 605 .shutdown = omap2_onenand_shutdown, 604 606 .driver = { 605 607 .name = DRIVER_NAME,
+2 -4
drivers/mtd/nand/onenand/onenand_samsung.c
··· 943 943 return 0; 944 944 } 945 945 946 - static int s3c_onenand_remove(struct platform_device *pdev) 946 + static void s3c_onenand_remove(struct platform_device *pdev) 947 947 { 948 948 struct mtd_info *mtd = platform_get_drvdata(pdev); 949 949 950 950 onenand_release(mtd); 951 - 952 - return 0; 953 951 } 954 952 955 953 static int s3c_pm_ops_suspend(struct device *dev) ··· 994 996 }, 995 997 .id_table = s3c_onenand_driver_ids, 996 998 .probe = s3c_onenand_probe, 997 - .remove = s3c_onenand_remove, 999 + .remove_new = s3c_onenand_remove, 998 1000 }; 999 1001 1000 1002 module_platform_driver(s3c_onenand_driver);
+1 -1
drivers/mtd/nand/raw/Kconfig
··· 373 373 374 374 config MTD_NAND_STM32_FMC2 375 375 tristate "Support for NAND controller on STM32MP SoCs" 376 - depends on MACH_STM32MP157 || COMPILE_TEST 376 + depends on ARCH_STM32 || COMPILE_TEST 377 377 select MFD_SYSCON 378 378 help 379 379 Enables support for NAND Flash chips on SoCs containing the FMC2
+2 -4
drivers/mtd/nand/raw/ams-delta.c
··· 397 397 /* 398 398 * Clean up routine 399 399 */ 400 - static int gpio_nand_remove(struct platform_device *pdev) 400 + static void gpio_nand_remove(struct platform_device *pdev) 401 401 { 402 402 struct gpio_nand *priv = platform_get_drvdata(pdev); 403 403 struct mtd_info *mtd = nand_to_mtd(&priv->nand_chip); ··· 410 410 ret = mtd_device_unregister(mtd); 411 411 WARN_ON(ret); 412 412 nand_cleanup(mtd_to_nand(mtd)); 413 - 414 - return 0; 415 413 } 416 414 417 415 #ifdef CONFIG_OF ··· 432 434 433 435 static struct platform_driver gpio_nand_driver = { 434 436 .probe = gpio_nand_probe, 435 - .remove = gpio_nand_remove, 437 + .remove_new = gpio_nand_remove, 436 438 .id_table = gpio_nand_plat_id_table, 437 439 .driver = { 438 440 .name = "ams-delta-nand",
+2 -4
drivers/mtd/nand/raw/arasan-nand-controller.c
··· 1496 1496 return ret; 1497 1497 } 1498 1498 1499 - static int anfc_remove(struct platform_device *pdev) 1499 + static void anfc_remove(struct platform_device *pdev) 1500 1500 { 1501 1501 struct arasan_nfc *nfc = platform_get_drvdata(pdev); 1502 1502 ··· 1504 1504 1505 1505 clk_disable_unprepare(nfc->bus_clk); 1506 1506 clk_disable_unprepare(nfc->controller_clk); 1507 - 1508 - return 0; 1509 1507 } 1510 1508 1511 1509 static const struct of_device_id anfc_ids[] = { ··· 1523 1525 .of_match_table = anfc_ids, 1524 1526 }, 1525 1527 .probe = anfc_probe, 1526 - .remove = anfc_remove, 1528 + .remove_new = anfc_remove, 1527 1529 }; 1528 1530 module_platform_driver(anfc_driver); 1529 1531
+2 -4
drivers/mtd/nand/raw/atmel/nand-controller.c
··· 2626 2626 return caps->ops->probe(pdev, caps); 2627 2627 } 2628 2628 2629 - static int atmel_nand_controller_remove(struct platform_device *pdev) 2629 + static void atmel_nand_controller_remove(struct platform_device *pdev) 2630 2630 { 2631 2631 struct atmel_nand_controller *nc = platform_get_drvdata(pdev); 2632 2632 2633 2633 WARN_ON(nc->caps->ops->remove(nc)); 2634 - 2635 - return 0; 2636 2634 } 2637 2635 2638 2636 static __maybe_unused int atmel_nand_controller_resume(struct device *dev) ··· 2661 2663 .pm = &atmel_nand_controller_pm_ops, 2662 2664 }, 2663 2665 .probe = atmel_nand_controller_probe, 2664 - .remove = atmel_nand_controller_remove, 2666 + .remove_new = atmel_nand_controller_remove, 2665 2667 }; 2666 2668 module_platform_driver(atmel_nand_controller_driver); 2667 2669
+2 -3
drivers/mtd/nand/raw/au1550nd.c
··· 337 337 return ret; 338 338 } 339 339 340 - static int au1550nd_remove(struct platform_device *pdev) 340 + static void au1550nd_remove(struct platform_device *pdev) 341 341 { 342 342 struct au1550nd_ctx *ctx = platform_get_drvdata(pdev); 343 343 struct resource *r = platform_get_resource(pdev, IORESOURCE_MEM, 0); ··· 350 350 iounmap(ctx->base); 351 351 release_mem_region(r->start, 0x1000); 352 352 kfree(ctx); 353 - return 0; 354 353 } 355 354 356 355 static struct platform_driver au1550nd_driver = { ··· 357 358 .name = "au1550-nand", 358 359 }, 359 360 .probe = au1550nd_probe, 360 - .remove = au1550nd_remove, 361 + .remove_new = au1550nd_remove, 361 362 }; 362 363 363 364 module_platform_driver(au1550nd_driver);
+2 -4
drivers/mtd/nand/raw/bcm47xxnflash/main.c
··· 57 57 return 0; 58 58 } 59 59 60 - static int bcm47xxnflash_remove(struct platform_device *pdev) 60 + static void bcm47xxnflash_remove(struct platform_device *pdev) 61 61 { 62 62 struct bcm47xxnflash *nflash = platform_get_drvdata(pdev); 63 63 struct nand_chip *chip = &nflash->nand_chip; ··· 66 66 ret = mtd_device_unregister(nand_to_mtd(chip)); 67 67 WARN_ON(ret); 68 68 nand_cleanup(chip); 69 - 70 - return 0; 71 69 } 72 70 73 71 static struct platform_driver bcm47xxnflash_driver = { 74 72 .probe = bcm47xxnflash_probe, 75 - .remove = bcm47xxnflash_remove, 73 + .remove_new = bcm47xxnflash_remove, 76 74 .driver = { 77 75 .name = "bcma_nflash", 78 76 },
+2 -4
drivers/mtd/nand/raw/cadence-nand-controller.c
··· 3055 3055 return 0; 3056 3056 } 3057 3057 3058 - static int cadence_nand_dt_remove(struct platform_device *ofdev) 3058 + static void cadence_nand_dt_remove(struct platform_device *ofdev) 3059 3059 { 3060 3060 struct cadence_nand_dt *dt = platform_get_drvdata(ofdev); 3061 3061 3062 3062 cadence_nand_remove(&dt->cdns_ctrl); 3063 - 3064 - return 0; 3065 3063 } 3066 3064 3067 3065 static struct platform_driver cadence_nand_dt_driver = { 3068 3066 .probe = cadence_nand_dt_probe, 3069 - .remove = cadence_nand_dt_remove, 3067 + .remove_new = cadence_nand_dt_remove, 3070 3068 .driver = { 3071 3069 .name = "cadence-nand-controller", 3072 3070 .of_match_table = cadence_nand_dt_ids,
+2 -4
drivers/mtd/nand/raw/davinci_nand.c
··· 821 821 return ret; 822 822 } 823 823 824 - static int nand_davinci_remove(struct platform_device *pdev) 824 + static void nand_davinci_remove(struct platform_device *pdev) 825 825 { 826 826 struct davinci_nand_info *info = platform_get_drvdata(pdev); 827 827 struct nand_chip *chip = &info->chip; ··· 835 835 ret = mtd_device_unregister(nand_to_mtd(chip)); 836 836 WARN_ON(ret); 837 837 nand_cleanup(chip); 838 - 839 - return 0; 840 838 } 841 839 842 840 static struct platform_driver nand_davinci_driver = { 843 841 .probe = nand_davinci_probe, 844 - .remove = nand_davinci_remove, 842 + .remove_new = nand_davinci_remove, 845 843 .driver = { 846 844 .name = "davinci_nand", 847 845 .of_match_table = of_match_ptr(davinci_nand_of_match),
+2 -4
drivers/mtd/nand/raw/denali_dt.c
··· 233 233 return ret; 234 234 } 235 235 236 - static int denali_dt_remove(struct platform_device *pdev) 236 + static void denali_dt_remove(struct platform_device *pdev) 237 237 { 238 238 struct denali_dt *dt = platform_get_drvdata(pdev); 239 239 ··· 243 243 clk_disable_unprepare(dt->clk_ecc); 244 244 clk_disable_unprepare(dt->clk_x); 245 245 clk_disable_unprepare(dt->clk); 246 - 247 - return 0; 248 246 } 249 247 250 248 static struct platform_driver denali_dt_driver = { 251 249 .probe = denali_dt_probe, 252 - .remove = denali_dt_remove, 250 + .remove_new = denali_dt_remove, 253 251 .driver = { 254 252 .name = "denali-nand-dt", 255 253 .of_match_table = denali_nand_dt_ids,
+2 -4
drivers/mtd/nand/raw/fsl_elbc_nand.c
··· 963 963 return ret; 964 964 } 965 965 966 - static int fsl_elbc_nand_remove(struct platform_device *pdev) 966 + static void fsl_elbc_nand_remove(struct platform_device *pdev) 967 967 { 968 968 struct fsl_elbc_fcm_ctrl *elbc_fcm_ctrl = fsl_lbc_ctrl_dev->nand; 969 969 struct fsl_elbc_mtd *priv = dev_get_drvdata(&pdev->dev); ··· 984 984 } 985 985 mutex_unlock(&fsl_elbc_nand_mutex); 986 986 987 - return 0; 988 - 989 987 } 990 988 991 989 static const struct of_device_id fsl_elbc_nand_match[] = { ··· 998 1000 .of_match_table = fsl_elbc_nand_match, 999 1001 }, 1000 1002 .probe = fsl_elbc_nand_probe, 1001 - .remove = fsl_elbc_nand_remove, 1003 + .remove_new = fsl_elbc_nand_remove, 1002 1004 }; 1003 1005 1004 1006 module_platform_driver(fsl_elbc_nand_driver);
+2 -4
drivers/mtd/nand/raw/fsl_ifc_nand.c
··· 1094 1094 return ret; 1095 1095 } 1096 1096 1097 - static int fsl_ifc_nand_remove(struct platform_device *dev) 1097 + static void fsl_ifc_nand_remove(struct platform_device *dev) 1098 1098 { 1099 1099 struct fsl_ifc_mtd *priv = dev_get_drvdata(&dev->dev); 1100 1100 struct nand_chip *chip = &priv->chip; ··· 1113 1113 kfree(ifc_nand_ctrl); 1114 1114 } 1115 1115 mutex_unlock(&fsl_ifc_nand_mutex); 1116 - 1117 - return 0; 1118 1116 } 1119 1117 1120 1118 static const struct of_device_id fsl_ifc_nand_match[] = { ··· 1129 1131 .of_match_table = fsl_ifc_nand_match, 1130 1132 }, 1131 1133 .probe = fsl_ifc_nand_probe, 1132 - .remove = fsl_ifc_nand_remove, 1134 + .remove_new = fsl_ifc_nand_remove, 1133 1135 }; 1134 1136 1135 1137 module_platform_driver(fsl_ifc_nand_driver);
+2 -4
drivers/mtd/nand/raw/fsl_upm.c
··· 235 235 return 0; 236 236 } 237 237 238 - static int fun_remove(struct platform_device *ofdev) 238 + static void fun_remove(struct platform_device *ofdev) 239 239 { 240 240 struct fsl_upm_nand *fun = dev_get_drvdata(&ofdev->dev); 241 241 struct nand_chip *chip = &fun->chip; ··· 245 245 ret = mtd_device_unregister(mtd); 246 246 WARN_ON(ret); 247 247 nand_cleanup(chip); 248 - 249 - return 0; 250 248 } 251 249 252 250 static const struct of_device_id of_fun_match[] = { ··· 259 261 .of_match_table = of_fun_match, 260 262 }, 261 263 .probe = fun_probe, 262 - .remove = fun_remove, 264 + .remove_new = fun_remove, 263 265 }; 264 266 265 267 module_platform_driver(of_fun_driver);
+2 -4
drivers/mtd/nand/raw/fsmc_nand.c
··· 1165 1165 /* 1166 1166 * Clean up routine 1167 1167 */ 1168 - static int fsmc_nand_remove(struct platform_device *pdev) 1168 + static void fsmc_nand_remove(struct platform_device *pdev) 1169 1169 { 1170 1170 struct fsmc_nand_data *host = platform_get_drvdata(pdev); 1171 1171 ··· 1184 1184 } 1185 1185 clk_disable_unprepare(host->clk); 1186 1186 } 1187 - 1188 - return 0; 1189 1187 } 1190 1188 1191 1189 #ifdef CONFIG_PM_SLEEP ··· 1222 1224 MODULE_DEVICE_TABLE(of, fsmc_nand_id_table); 1223 1225 1224 1226 static struct platform_driver fsmc_nand_driver = { 1225 - .remove = fsmc_nand_remove, 1227 + .remove_new = fsmc_nand_remove, 1226 1228 .driver = { 1227 1229 .name = "fsmc-nand", 1228 1230 .of_match_table = fsmc_nand_id_table,
+2 -4
drivers/mtd/nand/raw/gpio.c
··· 265 265 return platform_get_resource(pdev, IORESOURCE_MEM, 1); 266 266 } 267 267 268 - static int gpio_nand_remove(struct platform_device *pdev) 268 + static void gpio_nand_remove(struct platform_device *pdev) 269 269 { 270 270 struct gpiomtd *gpiomtd = platform_get_drvdata(pdev); 271 271 struct nand_chip *chip = &gpiomtd->nand_chip; ··· 280 280 gpiod_set_value(gpiomtd->nwp, 0); 281 281 if (gpiomtd->nce && !IS_ERR(gpiomtd->nce)) 282 282 gpiod_set_value(gpiomtd->nce, 0); 283 - 284 - return 0; 285 283 } 286 284 287 285 static int gpio_nand_probe(struct platform_device *pdev) ··· 392 394 393 395 static struct platform_driver gpio_nand_driver = { 394 396 .probe = gpio_nand_probe, 395 - .remove = gpio_nand_remove, 397 + .remove_new = gpio_nand_remove, 396 398 .driver = { 397 399 .name = "gpio-nand", 398 400 .of_match_table = of_match_ptr(gpio_nand_id_table),
+2 -3
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
··· 2777 2777 return ret; 2778 2778 } 2779 2779 2780 - static int gpmi_nand_remove(struct platform_device *pdev) 2780 + static void gpmi_nand_remove(struct platform_device *pdev) 2781 2781 { 2782 2782 struct gpmi_nand_data *this = platform_get_drvdata(pdev); 2783 2783 struct nand_chip *chip = &this->nand; ··· 2791 2791 nand_cleanup(chip); 2792 2792 gpmi_free_dma_buffer(this); 2793 2793 release_resources(this); 2794 - return 0; 2795 2794 } 2796 2795 2797 2796 #ifdef CONFIG_PM_SLEEP ··· 2859 2860 .of_match_table = gpmi_nand_id_table, 2860 2861 }, 2861 2862 .probe = gpmi_nand_probe, 2862 - .remove = gpmi_nand_remove, 2863 + .remove_new = gpmi_nand_remove, 2863 2864 }; 2864 2865 module_platform_driver(gpmi_nand_driver); 2865 2866
+2 -4
drivers/mtd/nand/raw/hisi504_nand.c
··· 798 798 return 0; 799 799 } 800 800 801 - static int hisi_nfc_remove(struct platform_device *pdev) 801 + static void hisi_nfc_remove(struct platform_device *pdev) 802 802 { 803 803 struct hinfc_host *host = platform_get_drvdata(pdev); 804 804 struct nand_chip *chip = &host->chip; ··· 807 807 ret = mtd_device_unregister(nand_to_mtd(chip)); 808 808 WARN_ON(ret); 809 809 nand_cleanup(chip); 810 - 811 - return 0; 812 810 } 813 811 814 812 #ifdef CONFIG_PM_SLEEP ··· 858 860 .pm = &hisi_nfc_pm_ops, 859 861 }, 860 862 .probe = hisi_nfc_probe, 861 - .remove = hisi_nfc_remove, 863 + .remove_new = hisi_nfc_remove, 862 864 }; 863 865 864 866 module_platform_driver(hisi_nfc_driver);
+2 -4
drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c
··· 522 522 return 0; 523 523 } 524 524 525 - static int ingenic_nand_remove(struct platform_device *pdev) 525 + static void ingenic_nand_remove(struct platform_device *pdev) 526 526 { 527 527 struct ingenic_nfc *nfc = platform_get_drvdata(pdev); 528 528 ··· 530 530 ingenic_ecc_release(nfc->ecc); 531 531 532 532 ingenic_nand_cleanup_chips(nfc); 533 - 534 - return 0; 535 533 } 536 534 537 535 static const struct jz_soc_info jz4740_soc_info = { ··· 562 564 563 565 static struct platform_driver ingenic_nand_driver = { 564 566 .probe = ingenic_nand_probe, 565 - .remove = ingenic_nand_remove, 567 + .remove_new = ingenic_nand_remove, 566 568 .driver = { 567 569 .name = DRV_NAME, 568 570 .of_match_table = ingenic_nand_dt_match,
+2 -4
drivers/mtd/nand/raw/intel-nand-controller.c
··· 706 706 return ret; 707 707 } 708 708 709 - static int ebu_nand_remove(struct platform_device *pdev) 709 + static void ebu_nand_remove(struct platform_device *pdev) 710 710 { 711 711 struct ebu_nand_controller *ebu_host = platform_get_drvdata(pdev); 712 712 int ret; ··· 717 717 ebu_nand_disable(&ebu_host->chip); 718 718 ebu_dma_cleanup(ebu_host); 719 719 clk_disable_unprepare(ebu_host->clk); 720 - 721 - return 0; 722 720 } 723 721 724 722 static const struct of_device_id ebu_nand_match[] = { ··· 727 729 728 730 static struct platform_driver ebu_nand_driver = { 729 731 .probe = ebu_nand_probe, 730 - .remove = ebu_nand_remove, 732 + .remove_new = ebu_nand_remove, 731 733 .driver = { 732 734 .name = "intel-nand-controller", 733 735 .of_match_table = ebu_nand_match,
+2 -4
drivers/mtd/nand/raw/lpc32xx_mlc.c
··· 827 827 /* 828 828 * Remove NAND device 829 829 */ 830 - static int lpc32xx_nand_remove(struct platform_device *pdev) 830 + static void lpc32xx_nand_remove(struct platform_device *pdev) 831 831 { 832 832 struct lpc32xx_nand_host *host = platform_get_drvdata(pdev); 833 833 struct nand_chip *chip = &host->nand_chip; ··· 846 846 847 847 lpc32xx_wp_enable(host); 848 848 gpiod_put(host->wp_gpio); 849 - 850 - return 0; 851 849 } 852 850 853 851 static int lpc32xx_nand_resume(struct platform_device *pdev) ··· 887 889 888 890 static struct platform_driver lpc32xx_nand_driver = { 889 891 .probe = lpc32xx_nand_probe, 890 - .remove = lpc32xx_nand_remove, 892 + .remove_new = lpc32xx_nand_remove, 891 893 .resume = pm_ptr(lpc32xx_nand_resume), 892 894 .suspend = pm_ptr(lpc32xx_nand_suspend), 893 895 .driver = {
+2 -4
drivers/mtd/nand/raw/lpc32xx_slc.c
··· 946 946 /* 947 947 * Remove NAND device. 948 948 */ 949 - static int lpc32xx_nand_remove(struct platform_device *pdev) 949 + static void lpc32xx_nand_remove(struct platform_device *pdev) 950 950 { 951 951 uint32_t tmp; 952 952 struct lpc32xx_nand_host *host = platform_get_drvdata(pdev); ··· 965 965 966 966 clk_disable_unprepare(host->clk); 967 967 lpc32xx_wp_enable(host); 968 - 969 - return 0; 970 968 } 971 969 972 970 static int lpc32xx_nand_resume(struct platform_device *pdev) ··· 1013 1015 1014 1016 static struct platform_driver lpc32xx_nand_driver = { 1015 1017 .probe = lpc32xx_nand_probe, 1016 - .remove = lpc32xx_nand_remove, 1018 + .remove_new = lpc32xx_nand_remove, 1017 1019 .resume = pm_ptr(lpc32xx_nand_resume), 1018 1020 .suspend = pm_ptr(lpc32xx_nand_suspend), 1019 1021 .driver = {
+2 -4
drivers/mtd/nand/raw/marvell_nand.c
··· 3004 3004 return ret; 3005 3005 } 3006 3006 3007 - static int marvell_nfc_remove(struct platform_device *pdev) 3007 + static void marvell_nfc_remove(struct platform_device *pdev) 3008 3008 { 3009 3009 struct marvell_nfc *nfc = platform_get_drvdata(pdev); 3010 3010 ··· 3017 3017 3018 3018 clk_disable_unprepare(nfc->reg_clk); 3019 3019 clk_disable_unprepare(nfc->core_clk); 3020 - 3021 - return 0; 3022 3020 } 3023 3021 3024 3022 static int __maybe_unused marvell_nfc_suspend(struct device *dev) ··· 3152 3154 }, 3153 3155 .id_table = marvell_nfc_platform_ids, 3154 3156 .probe = marvell_nfc_probe, 3155 - .remove = marvell_nfc_remove, 3157 + .remove_new = marvell_nfc_remove, 3156 3158 }; 3157 3159 module_platform_driver(marvell_nfc_driver); 3158 3160
+2 -4
drivers/mtd/nand/raw/meson_nand.c
··· 1434 1434 return ret; 1435 1435 } 1436 1436 1437 - static int meson_nfc_remove(struct platform_device *pdev) 1437 + static void meson_nfc_remove(struct platform_device *pdev) 1438 1438 { 1439 1439 struct meson_nfc *nfc = platform_get_drvdata(pdev); 1440 1440 1441 1441 meson_nfc_nand_chip_cleanup(nfc); 1442 1442 1443 1443 meson_nfc_disable_clk(nfc); 1444 - 1445 - return 0; 1446 1444 } 1447 1445 1448 1446 static struct platform_driver meson_nfc_driver = { 1449 1447 .probe = meson_nfc_probe, 1450 - .remove = meson_nfc_remove, 1448 + .remove_new = meson_nfc_remove, 1451 1449 .driver = { 1452 1450 .name = "meson-nand", 1453 1451 .of_match_table = meson_nfc_id_table,
+2 -4
drivers/mtd/nand/raw/mpc5121_nfc.c
··· 822 822 return retval; 823 823 } 824 824 825 - static int mpc5121_nfc_remove(struct platform_device *op) 825 + static void mpc5121_nfc_remove(struct platform_device *op) 826 826 { 827 827 struct device *dev = &op->dev; 828 828 struct mtd_info *mtd = dev_get_drvdata(dev); ··· 832 832 WARN_ON(ret); 833 833 nand_cleanup(mtd_to_nand(mtd)); 834 834 mpc5121_nfc_free(dev, mtd); 835 - 836 - return 0; 837 835 } 838 836 839 837 static const struct of_device_id mpc5121_nfc_match[] = { ··· 842 844 843 845 static struct platform_driver mpc5121_nfc_driver = { 844 846 .probe = mpc5121_nfc_probe, 845 - .remove = mpc5121_nfc_remove, 847 + .remove_new = mpc5121_nfc_remove, 846 848 .driver = { 847 849 .name = DRV_NAME, 848 850 .of_match_table = mpc5121_nfc_match,
+2 -4
drivers/mtd/nand/raw/mtk_nand.c
··· 1601 1601 return ret; 1602 1602 } 1603 1603 1604 - static int mtk_nfc_remove(struct platform_device *pdev) 1604 + static void mtk_nfc_remove(struct platform_device *pdev) 1605 1605 { 1606 1606 struct mtk_nfc *nfc = platform_get_drvdata(pdev); 1607 1607 struct mtk_nfc_nand_chip *mtk_chip; ··· 1620 1620 1621 1621 mtk_ecc_release(nfc->ecc); 1622 1622 mtk_nfc_disable_clk(&nfc->clk); 1623 - 1624 - return 0; 1625 1623 } 1626 1624 1627 1625 #ifdef CONFIG_PM_SLEEP ··· 1661 1663 1662 1664 static struct platform_driver mtk_nfc_driver = { 1663 1665 .probe = mtk_nfc_probe, 1664 - .remove = mtk_nfc_remove, 1666 + .remove_new = mtk_nfc_remove, 1665 1667 .driver = { 1666 1668 .name = MTK_NAME, 1667 1669 .of_match_table = mtk_nfc_id_table,
+2 -14
drivers/mtd/nand/raw/mxc_nand.c
··· 1599 1599 return host->devtype_data == &imx25_nand_devtype_data; 1600 1600 } 1601 1601 1602 - static inline int is_imx51_nfc(struct mxc_nand_host *host) 1603 - { 1604 - return host->devtype_data == &imx51_nand_devtype_data; 1605 - } 1606 - 1607 - static inline int is_imx53_nfc(struct mxc_nand_host *host) 1608 - { 1609 - return host->devtype_data == &imx53_nand_devtype_data; 1610 - } 1611 - 1612 1602 static const struct of_device_id mxcnd_dt_ids[] = { 1613 1603 { .compatible = "fsl,imx21-nand", .data = &imx21_nand_devtype_data, }, 1614 1604 { .compatible = "fsl,imx27-nand", .data = &imx27_nand_devtype_data, }, ··· 1821 1831 return err; 1822 1832 } 1823 1833 1824 - static int mxcnd_remove(struct platform_device *pdev) 1834 + static void mxcnd_remove(struct platform_device *pdev) 1825 1835 { 1826 1836 struct mxc_nand_host *host = platform_get_drvdata(pdev); 1827 1837 struct nand_chip *chip = &host->nand; ··· 1832 1842 nand_cleanup(chip); 1833 1843 if (host->clk_act) 1834 1844 clk_disable_unprepare(host->clk); 1835 - 1836 - return 0; 1837 1845 } 1838 1846 1839 1847 static struct platform_driver mxcnd_driver = { ··· 1840 1852 .of_match_table = mxcnd_dt_ids, 1841 1853 }, 1842 1854 .probe = mxcnd_probe, 1843 - .remove = mxcnd_remove, 1855 + .remove_new = mxcnd_remove, 1844 1856 }; 1845 1857 module_platform_driver(mxcnd_driver); 1846 1858
+2 -3
drivers/mtd/nand/raw/mxic_nand.c
··· 553 553 return err; 554 554 } 555 555 556 - static int mxic_nfc_remove(struct platform_device *pdev) 556 + static void mxic_nfc_remove(struct platform_device *pdev) 557 557 { 558 558 struct mxic_nand_ctlr *nfc = platform_get_drvdata(pdev); 559 559 struct nand_chip *chip = &nfc->chip; ··· 564 564 nand_cleanup(chip); 565 565 566 566 mxic_nfc_clk_disable(nfc); 567 - return 0; 568 567 } 569 568 570 569 static const struct of_device_id mxic_nfc_of_ids[] = { ··· 574 575 575 576 static struct platform_driver mxic_nfc_driver = { 576 577 .probe = mxic_nfc_probe, 577 - .remove = mxic_nfc_remove, 578 + .remove_new = mxic_nfc_remove, 578 579 .driver = { 579 580 .name = "mxic-nfc", 580 581 .of_match_table = mxic_nfc_of_ids,
+13
drivers/mtd/nand/raw/nand_hynix.c
··· 728 728 return ret; 729 729 } 730 730 731 + static void hynix_fixup_onfi_param_page(struct nand_chip *chip, 732 + struct nand_onfi_params *p) 733 + { 734 + /* 735 + * Certain chips might report a 0 on sdr_timing_mode field 736 + * (bytes 129-130). This has been seen on H27U4G8F2GDA-BI. 737 + * According to ONFI specification, bit 0 of this field "shall be 1". 738 + * Forcibly set this bit. 739 + */ 740 + p->sdr_timing_modes |= cpu_to_le16(BIT(0)); 741 + } 742 + 731 743 const struct nand_manufacturer_ops hynix_nand_manuf_ops = { 732 744 .detect = hynix_nand_decode_id, 733 745 .init = hynix_nand_init, 734 746 .cleanup = hynix_nand_cleanup, 747 + .fixup_onfi_param_page = hynix_fixup_onfi_param_page, 735 748 };
+2 -4
drivers/mtd/nand/raw/ndfc.c
··· 240 240 return 0; 241 241 } 242 242 243 - static int ndfc_remove(struct platform_device *ofdev) 243 + static void ndfc_remove(struct platform_device *ofdev) 244 244 { 245 245 struct ndfc_controller *ndfc = dev_get_drvdata(&ofdev->dev); 246 246 struct nand_chip *chip = &ndfc->chip; ··· 251 251 WARN_ON(ret); 252 252 nand_cleanup(chip); 253 253 kfree(mtd->name); 254 - 255 - return 0; 256 254 } 257 255 258 256 static const struct of_device_id ndfc_match[] = { ··· 265 267 .of_match_table = ndfc_match, 266 268 }, 267 269 .probe = ndfc_probe, 268 - .remove = ndfc_remove, 270 + .remove_new = ndfc_remove, 269 271 }; 270 272 271 273 module_platform_driver(ndfc_driver);
+2 -3
drivers/mtd/nand/raw/omap2.c
··· 2273 2273 return err; 2274 2274 } 2275 2275 2276 - static int omap_nand_remove(struct platform_device *pdev) 2276 + static void omap_nand_remove(struct platform_device *pdev) 2277 2277 { 2278 2278 struct mtd_info *mtd = platform_get_drvdata(pdev); 2279 2279 struct nand_chip *nand_chip = mtd_to_nand(mtd); ··· 2285 2285 dma_release_channel(info->dma); 2286 2286 WARN_ON(mtd_device_unregister(mtd)); 2287 2287 nand_cleanup(nand_chip); 2288 - return 0; 2289 2288 } 2290 2289 2291 2290 /* omap_nand_ids defined in linux/platform_data/mtd-nand-omap2.h */ ··· 2292 2293 2293 2294 static struct platform_driver omap_nand_driver = { 2294 2295 .probe = omap_nand_probe, 2295 - .remove = omap_nand_remove, 2296 + .remove_new = omap_nand_remove, 2296 2297 .driver = { 2297 2298 .name = DRIVER_NAME, 2298 2299 .of_match_table = omap_nand_ids,
+2 -3
drivers/mtd/nand/raw/omap_elm.c
··· 422 422 return ret; 423 423 } 424 424 425 - static int elm_remove(struct platform_device *pdev) 425 + static void elm_remove(struct platform_device *pdev) 426 426 { 427 427 pm_runtime_put_sync(&pdev->dev); 428 428 pm_runtime_disable(&pdev->dev); 429 - return 0; 430 429 } 431 430 432 431 #ifdef CONFIG_PM_SLEEP ··· 560 561 .pm = &elm_pm_ops, 561 562 }, 562 563 .probe = elm_probe, 563 - .remove = elm_remove, 564 + .remove_new = elm_remove, 564 565 }; 565 566 566 567 module_platform_driver(elm_driver);
+3 -7
drivers/mtd/nand/raw/orion_nand.c
··· 102 102 struct mtd_info *mtd; 103 103 struct nand_chip *nc; 104 104 struct orion_nand_data *board; 105 - struct resource *res; 106 105 void __iomem *io_base; 107 106 int ret = 0; 108 107 u32 val = 0; ··· 118 119 info->controller.ops = &orion_nand_ops; 119 120 nc->controller = &info->controller; 120 121 121 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 122 - io_base = devm_ioremap_resource(&pdev->dev, res); 122 + io_base = devm_platform_ioremap_resource(pdev, 0); 123 123 124 124 if (IS_ERR(io_base)) 125 125 return PTR_ERR(io_base); ··· 205 207 return ret; 206 208 } 207 209 208 - static int orion_nand_remove(struct platform_device *pdev) 210 + static void orion_nand_remove(struct platform_device *pdev) 209 211 { 210 212 struct orion_nand_info *info = platform_get_drvdata(pdev); 211 213 struct nand_chip *chip = &info->chip; ··· 217 219 nand_cleanup(chip); 218 220 219 221 clk_disable_unprepare(info->clk); 220 - 221 - return 0; 222 222 } 223 223 224 224 #ifdef CONFIG_OF ··· 228 232 #endif 229 233 230 234 static struct platform_driver orion_nand_driver = { 231 - .remove = orion_nand_remove, 235 + .remove_new = orion_nand_remove, 232 236 .driver = { 233 237 .name = "orion_nand", 234 238 .of_match_table = of_match_ptr(orion_nand_of_match_table),
+2 -4
drivers/mtd/nand/raw/oxnas_nand.c
··· 171 171 return err; 172 172 } 173 173 174 - static int oxnas_nand_remove(struct platform_device *pdev) 174 + static void oxnas_nand_remove(struct platform_device *pdev) 175 175 { 176 176 struct oxnas_nand_ctrl *oxnas = platform_get_drvdata(pdev); 177 177 struct nand_chip *chip; ··· 184 184 } 185 185 186 186 clk_disable_unprepare(oxnas->clk); 187 - 188 - return 0; 189 187 } 190 188 191 189 static const struct of_device_id oxnas_nand_match[] = { ··· 194 196 195 197 static struct platform_driver oxnas_nand_driver = { 196 198 .probe = oxnas_nand_probe, 197 - .remove = oxnas_nand_remove, 199 + .remove_new = oxnas_nand_remove, 198 200 .driver = { 199 201 .name = "oxnas_nand", 200 202 .of_match_table = oxnas_nand_match,
+2 -4
drivers/mtd/nand/raw/pasemi_nand.c
··· 197 197 return err; 198 198 } 199 199 200 - static int pasemi_nand_remove(struct platform_device *ofdev) 200 + static void pasemi_nand_remove(struct platform_device *ofdev) 201 201 { 202 202 struct pasemi_ddata *ddata = platform_get_drvdata(ofdev); 203 203 struct mtd_info *pasemi_nand_mtd; ··· 218 218 219 219 /* Free the MTD device structure */ 220 220 kfree(ddata); 221 - 222 - return 0; 223 221 } 224 222 225 223 static const struct of_device_id pasemi_nand_match[] = ··· 237 239 .of_match_table = pasemi_nand_match, 238 240 }, 239 241 .probe = pasemi_nand_probe, 240 - .remove = pasemi_nand_remove, 242 + .remove_new = pasemi_nand_remove, 241 243 }; 242 244 243 245 module_platform_driver(pasemi_nand_driver);
+2 -4
drivers/mtd/nand/raw/pl35x-nand-controller.c
··· 1163 1163 return 0; 1164 1164 } 1165 1165 1166 - static int pl35x_nand_remove(struct platform_device *pdev) 1166 + static void pl35x_nand_remove(struct platform_device *pdev) 1167 1167 { 1168 1168 struct pl35x_nandc *nfc = platform_get_drvdata(pdev); 1169 1169 1170 1170 pl35x_nand_chips_cleanup(nfc); 1171 - 1172 - return 0; 1173 1171 } 1174 1172 1175 1173 static const struct of_device_id pl35x_nand_of_match[] = { ··· 1178 1180 1179 1181 static struct platform_driver pl35x_nandc_driver = { 1180 1182 .probe = pl35x_nand_probe, 1181 - .remove = pl35x_nand_remove, 1183 + .remove_new = pl35x_nand_remove, 1182 1184 .driver = { 1183 1185 .name = PL35X_NANDC_DRIVER_NAME, 1184 1186 .of_match_table = pl35x_nand_of_match,
+2 -4
drivers/mtd/nand/raw/plat_nand.c
··· 122 122 /* 123 123 * Remove a NAND device. 124 124 */ 125 - static int plat_nand_remove(struct platform_device *pdev) 125 + static void plat_nand_remove(struct platform_device *pdev) 126 126 { 127 127 struct plat_nand_data *data = platform_get_drvdata(pdev); 128 128 struct platform_nand_data *pdata = dev_get_platdata(&pdev->dev); ··· 134 134 nand_cleanup(chip); 135 135 if (pdata->ctrl.remove) 136 136 pdata->ctrl.remove(pdev); 137 - 138 - return 0; 139 137 } 140 138 141 139 static const struct of_device_id plat_nand_match[] = { ··· 144 146 145 147 static struct platform_driver plat_nand_driver = { 146 148 .probe = plat_nand_probe, 147 - .remove = plat_nand_remove, 149 + .remove_new = plat_nand_remove, 148 150 .driver = { 149 151 .name = "gen_nand", 150 152 .of_match_table = plat_nand_match,
+4 -7
drivers/mtd/nand/raw/qcom_nandc.c
··· 3054 3054 struct device *dev = nandc->dev; 3055 3055 int partitions_count, i, j, ret; 3056 3056 3057 - if (!of_find_property(dn, "qcom,boot-partitions", NULL)) 3057 + if (!of_property_present(dn, "qcom,boot-partitions")) 3058 3058 return 0; 3059 3059 3060 3060 partitions_count = of_property_count_u32_elems(dn, "qcom,boot-partitions"); ··· 3269 3269 if (ret) 3270 3270 return ret; 3271 3271 3272 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 3273 - nandc->base = devm_ioremap_resource(dev, res); 3272 + nandc->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); 3274 3273 if (IS_ERR(nandc->base)) 3275 3274 return PTR_ERR(nandc->base); 3276 3275 ··· 3314 3315 return ret; 3315 3316 } 3316 3317 3317 - static int qcom_nandc_remove(struct platform_device *pdev) 3318 + static void qcom_nandc_remove(struct platform_device *pdev) 3318 3319 { 3319 3320 struct qcom_nand_controller *nandc = platform_get_drvdata(pdev); 3320 3321 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ··· 3336 3337 3337 3338 dma_unmap_resource(&pdev->dev, nandc->base_dma, resource_size(res), 3338 3339 DMA_BIDIRECTIONAL, 0); 3339 - 3340 - return 0; 3341 3340 } 3342 3341 3343 3342 static const struct qcom_nandc_props ipq806x_nandc_props = { ··· 3402 3405 .of_match_table = qcom_nandc_of_match, 3403 3406 }, 3404 3407 .probe = qcom_nandc_probe, 3405 - .remove = qcom_nandc_remove, 3408 + .remove_new = qcom_nandc_remove, 3406 3409 }; 3407 3410 module_platform_driver(qcom_nandc_driver); 3408 3411
+2 -4
drivers/mtd/nand/raw/renesas-nand-controller.c
··· 1386 1386 return ret; 1387 1387 } 1388 1388 1389 - static int rnandc_remove(struct platform_device *pdev) 1389 + static void rnandc_remove(struct platform_device *pdev) 1390 1390 { 1391 1391 struct rnandc *rnandc = platform_get_drvdata(pdev); 1392 1392 1393 1393 rnandc_chips_cleanup(rnandc); 1394 1394 1395 1395 pm_runtime_put(&pdev->dev); 1396 - 1397 - return 0; 1398 1396 } 1399 1397 1400 1398 static const struct of_device_id rnandc_id_table[] = { ··· 1408 1410 .of_match_table = rnandc_id_table, 1409 1411 }, 1410 1412 .probe = rnandc_probe, 1411 - .remove = rnandc_remove, 1413 + .remove_new = rnandc_remove, 1412 1414 }; 1413 1415 module_platform_driver(rnandc_driver); 1414 1416
+2 -4
drivers/mtd/nand/raw/rockchip-nand-controller.c
··· 1427 1427 return ret; 1428 1428 } 1429 1429 1430 - static int rk_nfc_remove(struct platform_device *pdev) 1430 + static void rk_nfc_remove(struct platform_device *pdev) 1431 1431 { 1432 1432 struct rk_nfc *nfc = platform_get_drvdata(pdev); 1433 1433 ··· 1435 1435 kfree(nfc->oob_buf); 1436 1436 rk_nfc_chips_cleanup(nfc); 1437 1437 rk_nfc_disable_clks(nfc); 1438 - 1439 - return 0; 1440 1438 } 1441 1439 1442 1440 static int __maybe_unused rk_nfc_suspend(struct device *dev) ··· 1474 1476 1475 1477 static struct platform_driver rk_nfc_driver = { 1476 1478 .probe = rk_nfc_probe, 1477 - .remove = rk_nfc_remove, 1479 + .remove_new = rk_nfc_remove, 1478 1480 .driver = { 1479 1481 .name = "rockchip-nfc", 1480 1482 .of_match_table = rk_nfc_id_table,
+3 -5
drivers/mtd/nand/raw/s3c2410.c
··· 709 709 710 710 /* device management functions */ 711 711 712 - static int s3c24xx_nand_remove(struct platform_device *pdev) 712 + static void s3c24xx_nand_remove(struct platform_device *pdev) 713 713 { 714 714 struct s3c2410_nand_info *info = to_nand_info(pdev); 715 715 716 716 if (info == NULL) 717 - return 0; 717 + return; 718 718 719 719 /* Release all our mtds and their partitions, then go through 720 720 * freeing the resources used ··· 735 735 736 736 if (!IS_ERR(info->clk)) 737 737 s3c2410_nand_clk_set_state(info, CLOCK_DISABLE); 738 - 739 - return 0; 740 738 } 741 739 742 740 static int s3c2410_nand_add_partition(struct s3c2410_nand_info *info, ··· 1216 1218 1217 1219 static struct platform_driver s3c24xx_nand_driver = { 1218 1220 .probe = s3c24xx_nand_probe, 1219 - .remove = s3c24xx_nand_remove, 1221 + .remove_new = s3c24xx_nand_remove, 1220 1222 .suspend = s3c24xx_nand_suspend, 1221 1223 .resume = s3c24xx_nand_resume, 1222 1224 .id_table = s3c24xx_driver_ids,
+2 -4
drivers/mtd/nand/raw/sh_flctl.c
··· 1203 1203 return ret; 1204 1204 } 1205 1205 1206 - static int flctl_remove(struct platform_device *pdev) 1206 + static void flctl_remove(struct platform_device *pdev) 1207 1207 { 1208 1208 struct sh_flctl *flctl = platform_get_drvdata(pdev); 1209 1209 struct nand_chip *chip = &flctl->chip; ··· 1214 1214 WARN_ON(ret); 1215 1215 nand_cleanup(chip); 1216 1216 pm_runtime_disable(&pdev->dev); 1217 - 1218 - return 0; 1219 1217 } 1220 1218 1221 1219 static struct platform_driver flctl_driver = { 1222 - .remove = flctl_remove, 1220 + .remove_new = flctl_remove, 1223 1221 .driver = { 1224 1222 .name = "sh_flctl", 1225 1223 .of_match_table = of_flctl_match,
+2 -4
drivers/mtd/nand/raw/sharpsl.c
··· 210 210 /* 211 211 * Clean up routine 212 212 */ 213 - static int sharpsl_nand_remove(struct platform_device *pdev) 213 + static void sharpsl_nand_remove(struct platform_device *pdev) 214 214 { 215 215 struct sharpsl_nand *sharpsl = platform_get_drvdata(pdev); 216 216 struct nand_chip *chip = &sharpsl->chip; ··· 227 227 228 228 /* Free the driver's structure */ 229 229 kfree(sharpsl); 230 - 231 - return 0; 232 230 } 233 231 234 232 static struct platform_driver sharpsl_nand_driver = { ··· 234 236 .name = "sharpsl-nand", 235 237 }, 236 238 .probe = sharpsl_nand_probe, 237 - .remove = sharpsl_nand_remove, 239 + .remove_new = sharpsl_nand_remove, 238 240 }; 239 241 240 242 module_platform_driver(sharpsl_nand_driver);
+2 -4
drivers/mtd/nand/raw/socrates_nand.c
··· 201 201 /* 202 202 * Remove a NAND device. 203 203 */ 204 - static int socrates_nand_remove(struct platform_device *ofdev) 204 + static void socrates_nand_remove(struct platform_device *ofdev) 205 205 { 206 206 struct socrates_nand_host *host = dev_get_drvdata(&ofdev->dev); 207 207 struct nand_chip *chip = &host->nand_chip; ··· 212 212 nand_cleanup(chip); 213 213 214 214 iounmap(host->io_base); 215 - 216 - return 0; 217 215 } 218 216 219 217 static const struct of_device_id socrates_nand_match[] = ··· 230 232 .of_match_table = socrates_nand_match, 231 233 }, 232 234 .probe = socrates_nand_probe, 233 - .remove = socrates_nand_remove, 235 + .remove_new = socrates_nand_remove, 234 236 }; 235 237 236 238 module_platform_driver(socrates_nand_driver);
+2 -4
drivers/mtd/nand/raw/stm32_fmc2_nand.c
··· 2021 2021 return ret; 2022 2022 } 2023 2023 2024 - static int stm32_fmc2_nfc_remove(struct platform_device *pdev) 2024 + static void stm32_fmc2_nfc_remove(struct platform_device *pdev) 2025 2025 { 2026 2026 struct stm32_fmc2_nfc *nfc = platform_get_drvdata(pdev); 2027 2027 struct stm32_fmc2_nand *nand = &nfc->nand; ··· 2045 2045 clk_disable_unprepare(nfc->clk); 2046 2046 2047 2047 stm32_fmc2_nfc_wp_enable(nand); 2048 - 2049 - return 0; 2050 2048 } 2051 2049 2052 2050 static int __maybe_unused stm32_fmc2_nfc_suspend(struct device *dev) ··· 2101 2103 2102 2104 static struct platform_driver stm32_fmc2_nfc_driver = { 2103 2105 .probe = stm32_fmc2_nfc_probe, 2104 - .remove = stm32_fmc2_nfc_remove, 2106 + .remove_new = stm32_fmc2_nfc_remove, 2105 2107 .driver = { 2106 2108 .name = "stm32_fmc2_nfc", 2107 2109 .of_match_table = stm32_fmc2_nfc_match,
+2 -4
drivers/mtd/nand/raw/sunxi_nand.c
··· 2173 2173 return ret; 2174 2174 } 2175 2175 2176 - static int sunxi_nfc_remove(struct platform_device *pdev) 2176 + static void sunxi_nfc_remove(struct platform_device *pdev) 2177 2177 { 2178 2178 struct sunxi_nfc *nfc = platform_get_drvdata(pdev); 2179 2179 ··· 2185 2185 dma_release_channel(nfc->dmac); 2186 2186 clk_disable_unprepare(nfc->mod_clk); 2187 2187 clk_disable_unprepare(nfc->ahb_clk); 2188 - 2189 - return 0; 2190 2188 } 2191 2189 2192 2190 static const struct sunxi_nfc_caps sunxi_nfc_a10_caps = { ··· 2217 2219 .of_match_table = sunxi_nfc_ids, 2218 2220 }, 2219 2221 .probe = sunxi_nfc_probe, 2220 - .remove = sunxi_nfc_remove, 2222 + .remove_new = sunxi_nfc_remove, 2221 2223 }; 2222 2224 module_platform_driver(sunxi_nfc_driver); 2223 2225
+2 -4
drivers/mtd/nand/raw/tegra_nand.c
··· 1220 1220 return err; 1221 1221 } 1222 1222 1223 - static int tegra_nand_remove(struct platform_device *pdev) 1223 + static void tegra_nand_remove(struct platform_device *pdev) 1224 1224 { 1225 1225 struct tegra_nand_controller *ctrl = platform_get_drvdata(pdev); 1226 1226 struct nand_chip *chip = ctrl->chip; ··· 1232 1232 1233 1233 pm_runtime_put_sync_suspend(ctrl->dev); 1234 1234 pm_runtime_force_suspend(ctrl->dev); 1235 - 1236 - return 0; 1237 1235 } 1238 1236 1239 1237 static int __maybe_unused tegra_nand_runtime_resume(struct device *dev) ··· 1275 1277 .pm = &tegra_nand_pm, 1276 1278 }, 1277 1279 .probe = tegra_nand_probe, 1278 - .remove = tegra_nand_remove, 1280 + .remove_new = tegra_nand_remove, 1279 1281 }; 1280 1282 module_platform_driver(tegra_nand_driver); 1281 1283
+2 -3
drivers/mtd/nand/raw/vf610_nfc.c
··· 909 909 return err; 910 910 } 911 911 912 - static int vf610_nfc_remove(struct platform_device *pdev) 912 + static void vf610_nfc_remove(struct platform_device *pdev) 913 913 { 914 914 struct vf610_nfc *nfc = platform_get_drvdata(pdev); 915 915 struct nand_chip *chip = &nfc->chip; ··· 919 919 WARN_ON(ret); 920 920 nand_cleanup(chip); 921 921 clk_disable_unprepare(nfc->clk); 922 - return 0; 923 922 } 924 923 925 924 #ifdef CONFIG_PM_SLEEP ··· 954 955 .pm = &vf610_nfc_pm_ops, 955 956 }, 956 957 .probe = vf610_nfc_probe, 957 - .remove = vf610_nfc_remove, 958 + .remove_new = vf610_nfc_remove, 958 959 }; 959 960 960 961 module_platform_driver(vf610_nfc_driver);
+2 -4
drivers/mtd/nand/raw/xway_nand.c
··· 238 238 /* 239 239 * Remove a NAND device. 240 240 */ 241 - static int xway_nand_remove(struct platform_device *pdev) 241 + static void xway_nand_remove(struct platform_device *pdev) 242 242 { 243 243 struct xway_nand_data *data = platform_get_drvdata(pdev); 244 244 struct nand_chip *chip = &data->chip; ··· 247 247 ret = mtd_device_unregister(nand_to_mtd(chip)); 248 248 WARN_ON(ret); 249 249 nand_cleanup(chip); 250 - 251 - return 0; 252 250 } 253 251 254 252 static const struct of_device_id xway_nand_match[] = { ··· 256 258 257 259 static struct platform_driver xway_nand_driver = { 258 260 .probe = xway_nand_probe, 259 - .remove = xway_nand_remove, 261 + .remove_new = xway_nand_remove, 260 262 .driver = { 261 263 .name = "lantiq,nand-xway", 262 264 .of_match_table = xway_nand_match,
+2 -1
drivers/mtd/nand/spi/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 - spinand-objs := core.o alliancememory.o ato.o gigadevice.o macronix.o micron.o paragon.o toshiba.o winbond.o xtx.o 2 + spinand-objs := core.o alliancememory.o ato.o esmt.o gigadevice.o macronix.o 3 + spinand-objs += micron.o paragon.o toshiba.o winbond.o xtx.o 3 4 obj-$(CONFIG_MTD_SPI_NAND) += spinand.o
+1
drivers/mtd/nand/spi/core.c
··· 939 939 static const struct spinand_manufacturer *spinand_manufacturers[] = { 940 940 &alliancememory_spinand_manufacturer, 941 941 &ato_spinand_manufacturer, 942 + &esmt_c8_spinand_manufacturer, 942 943 &gigadevice_spinand_manufacturer, 943 944 &macronix_spinand_manufacturer, 944 945 &micron_spinand_manufacturer,
+135
drivers/mtd/nand/spi/esmt.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Author: 4 + * Chuanhong Guo <gch981213@gmail.com> - the main driver logic 5 + * Martin Kurbanov <mmkurbanov@sberdevices.ru> - OOB layout 6 + */ 7 + 8 + #include <linux/device.h> 9 + #include <linux/kernel.h> 10 + #include <linux/mtd/spinand.h> 11 + 12 + /* ESMT uses GigaDevice 0xc8 JECDEC ID on some SPI NANDs */ 13 + #define SPINAND_MFR_ESMT_C8 0xc8 14 + 15 + static SPINAND_OP_VARIANTS(read_cache_variants, 16 + SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0), 17 + SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0), 18 + SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0), 19 + SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0)); 20 + 21 + static SPINAND_OP_VARIANTS(write_cache_variants, 22 + SPINAND_PROG_LOAD_X4(true, 0, NULL, 0), 23 + SPINAND_PROG_LOAD(true, 0, NULL, 0)); 24 + 25 + static SPINAND_OP_VARIANTS(update_cache_variants, 26 + SPINAND_PROG_LOAD_X4(false, 0, NULL, 0), 27 + SPINAND_PROG_LOAD(false, 0, NULL, 0)); 28 + 29 + /* 30 + * OOB spare area map (64 bytes) 31 + * 32 + * Bad Block Markers 33 + * filled by HW and kernel Reserved 34 + * | +-----------------------+-----------------------+ 35 + * | | | | 36 + * | | OOB free data Area |non ECC protected | 37 + * | +-------------|-----+-----------------|-----+-----------------|-----+ 38 + * | | | | | | | | 39 + * +-|---|----------+--|-----|--------------+--|-----|--------------+--|-----|--------------+ 40 + * | | | section0 | | | section1 | | | section2 | | | section3 | 41 + * +-v-+-v-+---+----+--v--+--v--+-----+-----+--v--+--v--+-----+-----+--v--+--v--+-----+-----+ 42 + * | | | | | | | | | | | | | | | | | 43 + * |0:1|2:3|4:7|8:15|16:17|18:19|20:23|24:31|32:33|34:35|36:39|40:47|48:49|50:51|52:55|56:63| 44 + * | | | | | | | | | | | | | | | | | 45 + * +---+---+-^-+--^-+-----+-----+--^--+--^--+-----+-----+--^--+--^--+-----+-----+--^--+--^--+ 46 + * | | | | | | | | 47 + * | +----------------|-----+-----------------|-----+-----------------|-----+ 48 + * | ECC Area|(Main + Spare) - filled|by ESMT NAND HW | 49 + * | | | | 50 + * +---------------------+-----------------------+-----------------------+ 51 + * OOB ECC protected Area - not used due to 52 + * partial programming from some filesystems 53 + * (like JFFS2 with cleanmarkers) 54 + */ 55 + 56 + #define ESMT_OOB_SECTION_COUNT 4 57 + #define ESMT_OOB_SECTION_SIZE(nand) \ 58 + (nanddev_per_page_oobsize(nand) / ESMT_OOB_SECTION_COUNT) 59 + #define ESMT_OOB_FREE_SIZE(nand) \ 60 + (ESMT_OOB_SECTION_SIZE(nand) / 2) 61 + #define ESMT_OOB_ECC_SIZE(nand) \ 62 + (ESMT_OOB_SECTION_SIZE(nand) - ESMT_OOB_FREE_SIZE(nand)) 63 + #define ESMT_OOB_BBM_SIZE 2 64 + 65 + static int f50l1g41lb_ooblayout_ecc(struct mtd_info *mtd, int section, 66 + struct mtd_oob_region *region) 67 + { 68 + struct nand_device *nand = mtd_to_nanddev(mtd); 69 + 70 + if (section >= ESMT_OOB_SECTION_COUNT) 71 + return -ERANGE; 72 + 73 + region->offset = section * ESMT_OOB_SECTION_SIZE(nand) + 74 + ESMT_OOB_FREE_SIZE(nand); 75 + region->length = ESMT_OOB_ECC_SIZE(nand); 76 + 77 + return 0; 78 + } 79 + 80 + static int f50l1g41lb_ooblayout_free(struct mtd_info *mtd, int section, 81 + struct mtd_oob_region *region) 82 + { 83 + struct nand_device *nand = mtd_to_nanddev(mtd); 84 + 85 + if (section >= ESMT_OOB_SECTION_COUNT) 86 + return -ERANGE; 87 + 88 + /* 89 + * Reserve space for bad blocks markers (section0) and 90 + * reserved bytes (sections 1-3) 91 + */ 92 + region->offset = section * ESMT_OOB_SECTION_SIZE(nand) + 2; 93 + 94 + /* Use only 2 non-protected ECC bytes per each OOB section */ 95 + region->length = 2; 96 + 97 + return 0; 98 + } 99 + 100 + static const struct mtd_ooblayout_ops f50l1g41lb_ooblayout = { 101 + .ecc = f50l1g41lb_ooblayout_ecc, 102 + .free = f50l1g41lb_ooblayout_free, 103 + }; 104 + 105 + static const struct spinand_info esmt_c8_spinand_table[] = { 106 + SPINAND_INFO("F50L1G41LB", 107 + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0x01), 108 + NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1), 109 + NAND_ECCREQ(1, 512), 110 + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, 111 + &write_cache_variants, 112 + &update_cache_variants), 113 + 0, 114 + SPINAND_ECCINFO(&f50l1g41lb_ooblayout, NULL)), 115 + SPINAND_INFO("F50D1G41LB", 116 + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0x11), 117 + NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1), 118 + NAND_ECCREQ(1, 512), 119 + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, 120 + &write_cache_variants, 121 + &update_cache_variants), 122 + 0, 123 + SPINAND_ECCINFO(&f50l1g41lb_ooblayout, NULL)), 124 + }; 125 + 126 + static const struct spinand_manufacturer_ops esmt_spinand_manuf_ops = { 127 + }; 128 + 129 + const struct spinand_manufacturer esmt_c8_spinand_manufacturer = { 130 + .id = SPINAND_MFR_ESMT_C8, 131 + .name = "ESMT", 132 + .chips = esmt_c8_spinand_table, 133 + .nchips = ARRAY_SIZE(esmt_c8_spinand_table), 134 + .ops = &esmt_spinand_manuf_ops, 135 + };
+1 -1
drivers/mtd/parsers/Kconfig
··· 149 149 150 150 config MTD_SHARPSL_PARTS 151 151 tristate "Sharp SL Series NAND flash partition parser" 152 - depends on MTD_NAND_SHARPSL || MTD_NAND_TMIO || COMPILE_TEST 152 + depends on MTD_NAND_SHARPSL || COMPILE_TEST 153 153 help 154 154 This provides the read-only FTL logic necessary to read the partition 155 155 table from the NAND flash of Sharp SL Series (Zaurus) and the MTD
+1 -1
include/linux/mtd/rawnand.h
··· 1075 1075 * @exec_op: controller specific method to execute NAND operations. 1076 1076 * This method replaces chip->legacy.cmdfunc(), 1077 1077 * chip->legacy.{read,write}_{buf,byte,word}(), 1078 - * chip->legacy.dev_ready() and chip->legacy.waifunc(). 1078 + * chip->legacy.dev_ready() and chip->legacy.waitfunc(). 1079 1079 * @setup_interface: setup the data interface and timing. If chipnr is set to 1080 1080 * %NAND_DATA_IFACE_CHECK_ONLY this means the configuration 1081 1081 * should not be applied but only checked.
+1
include/linux/mtd/spinand.h
··· 262 262 /* SPI NAND manufacturers */ 263 263 extern const struct spinand_manufacturer alliancememory_spinand_manufacturer; 264 264 extern const struct spinand_manufacturer ato_spinand_manufacturer; 265 + extern const struct spinand_manufacturer esmt_c8_spinand_manufacturer; 265 266 extern const struct spinand_manufacturer gigadevice_spinand_manufacturer; 266 267 extern const struct spinand_manufacturer macronix_spinand_manufacturer; 267 268 extern const struct spinand_manufacturer micron_spinand_manufacturer;