Hello, This series aims at simplifying erase handling both in MTD drivers and MTD users code.
Historically, the erase operation has been designed to be asynchronous, which, in theory, is a good thing since erasing a block usually takes longer that reading/writing to a flash. In practice, all drivers are implementing ->_erase() in a synchronous manner. Moreover, both drivers and users are inconsistently updating/checking the erase_info fields. In order to simplify things, let's assume ->_erase() is and will always be synchronous. This also make error code checking more consistent and allows us to get rid of a few hundred lines of code. Regards, Boris Boris Brezillon (5): mtd: Initialize ->fail_addr early in mtd_erase() mtd: Get rid of unused fields in struct erase_info mtd: Stop assuming mtd_erase() is asynchronous mtd: Unconditionally update ->fail_addr and ->addr in part_erase() mtd: Stop updating erase_info->state and calling mtd_erase_callback() drivers/mtd/chips/cfi_cmdset_0001.c | 16 +----- drivers/mtd/chips/cfi_cmdset_0002.c | 26 ++------- drivers/mtd/chips/cfi_cmdset_0020.c | 3 -- drivers/mtd/chips/map_ram.c | 2 - drivers/mtd/devices/bcm47xxsflash.c | 12 +---- drivers/mtd/devices/block2mtd.c | 7 +-- drivers/mtd/devices/docg3.c | 16 +----- drivers/mtd/devices/lart.c | 4 -- drivers/mtd/devices/mtd_dataflash.c | 4 -- drivers/mtd/devices/mtdram.c | 2 - drivers/mtd/devices/phram.c | 2 - drivers/mtd/devices/pmc551.c | 2 - drivers/mtd/devices/powernv_flash.c | 11 +--- drivers/mtd/devices/slram.c | 2 - drivers/mtd/devices/spear_smi.c | 3 -- drivers/mtd/devices/sst25l.c | 3 -- drivers/mtd/devices/st_spi_fsm.c | 4 -- drivers/mtd/ftl.c | 52 +++--------------- drivers/mtd/inftlmount.c | 8 ++- drivers/mtd/lpddr/lpddr2_nvm.c | 10 +--- drivers/mtd/lpddr/lpddr_cmds.c | 2 - drivers/mtd/mtdblock.c | 21 -------- drivers/mtd/mtdchar.c | 34 +----------- drivers/mtd/mtdconcat.c | 48 +---------------- drivers/mtd/mtdcore.c | 17 +++--- drivers/mtd/mtdoops.c | 20 ------- drivers/mtd/mtdpart.c | 23 ++------ drivers/mtd/mtdswap.c | 34 ------------ drivers/mtd/nand/nand_base.c | 16 ++---- drivers/mtd/nand/nand_bbt.c | 1 - drivers/mtd/nftlmount.c | 5 +- drivers/mtd/onenand/onenand_base.c | 17 ------ drivers/mtd/rfd_ftl.c | 93 ++++++++++---------------------- drivers/mtd/sm_ftl.c | 19 ------- drivers/mtd/sm_ftl.h | 4 -- drivers/mtd/spi-nor/spi-nor.c | 3 -- drivers/mtd/tests/mtd_test.c | 5 -- drivers/mtd/tests/speedtest.c | 7 --- drivers/mtd/ubi/gluebi.c | 3 -- drivers/mtd/ubi/io.c | 36 ------------- drivers/net/ethernet/sfc/falcon/mtd.c | 11 +--- drivers/net/ethernet/sfc/mtd.c | 11 +--- drivers/staging/goldfish/goldfish_nand.c | 3 -- fs/jffs2/erase.c | 37 ++----------- include/linux/mtd/mtd.h | 19 +------ 45 files changed, 79 insertions(+), 599 deletions(-) -- 2.14.1 _______________________________________________ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel