• Home
  • Raw
  • Download

Lines Matching refs:fsm

314 static int stfsm_n25q_config(struct stfsm *fsm);
315 static int stfsm_mx25_config(struct stfsm *fsm);
316 static int stfsm_s25fl_config(struct stfsm *fsm);
317 static int stfsm_w25q_config(struct stfsm *fsm);
688 static inline int stfsm_is_idle(struct stfsm *fsm) in stfsm_is_idle() argument
690 return readl(fsm->base + SPI_FAST_SEQ_STA) & 0x10; in stfsm_is_idle()
693 static inline uint32_t stfsm_fifo_available(struct stfsm *fsm) in stfsm_fifo_available() argument
695 return (readl(fsm->base + SPI_FAST_SEQ_STA) >> 5) & 0x7f; in stfsm_fifo_available()
698 static void stfsm_clear_fifo(struct stfsm *fsm) in stfsm_clear_fifo() argument
703 avail = stfsm_fifo_available(fsm); in stfsm_clear_fifo()
708 readl(fsm->base + SPI_FAST_SEQ_DATA_REG); in stfsm_clear_fifo()
714 static inline void stfsm_load_seq(struct stfsm *fsm, in stfsm_load_seq() argument
717 void __iomem *dst = fsm->base + SPI_FAST_SEQ_TRANSFER_SIZE; in stfsm_load_seq()
721 BUG_ON(!stfsm_is_idle(fsm)); in stfsm_load_seq()
730 static void stfsm_wait_seq(struct stfsm *fsm) in stfsm_wait_seq() argument
741 if (stfsm_is_idle(fsm)) in stfsm_wait_seq()
747 dev_err(fsm->dev, "timeout on sequence completion\n"); in stfsm_wait_seq()
750 static void stfsm_read_fifo(struct stfsm *fsm, uint32_t *buf, uint32_t size) in stfsm_read_fifo() argument
756 dev_dbg(fsm->dev, "Reading %d bytes from FIFO\n", size); in stfsm_read_fifo()
762 avail = stfsm_fifo_available(fsm); in stfsm_read_fifo()
770 readsl(fsm->base + SPI_FAST_SEQ_DATA_REG, buf, words); in stfsm_read_fifo()
775 static int stfsm_write_fifo(struct stfsm *fsm, const uint32_t *buf, in stfsm_write_fifo() argument
780 dev_dbg(fsm->dev, "writing %d bytes to FIFO\n", size); in stfsm_write_fifo()
784 writesl(fsm->base + SPI_FAST_SEQ_DATA_REG, buf, words); in stfsm_write_fifo()
789 static int stfsm_enter_32bit_addr(struct stfsm *fsm, int enter) in stfsm_enter_32bit_addr() argument
791 struct stfsm_seq *seq = &fsm->stfsm_seq_en_32bit_addr; in stfsm_enter_32bit_addr()
799 stfsm_load_seq(fsm, seq); in stfsm_enter_32bit_addr()
801 stfsm_wait_seq(fsm); in stfsm_enter_32bit_addr()
806 static uint8_t stfsm_wait_busy(struct stfsm *fsm) in stfsm_wait_busy() argument
819 stfsm_load_seq(fsm, seq); in stfsm_wait_busy()
829 stfsm_wait_seq(fsm); in stfsm_wait_busy()
831 stfsm_read_fifo(fsm, &status, 4); in stfsm_wait_busy()
836 if ((fsm->configuration & CFG_S25FL_CHECK_ERROR_FLAGS) && in stfsm_wait_busy()
843 writel(seq->seq_cfg, fsm->base + SPI_FAST_SEQ_CFG); in stfsm_wait_busy()
848 dev_err(fsm->dev, "timeout on wait_busy\n"); in stfsm_wait_busy()
853 static int stfsm_read_status(struct stfsm *fsm, uint8_t cmd, in stfsm_read_status() argument
861 dev_dbg(fsm->dev, "read 'status' register [0x%02x], %d byte(s)\n", in stfsm_read_status()
869 stfsm_load_seq(fsm, seq); in stfsm_read_status()
871 stfsm_read_fifo(fsm, &tmp, 4); in stfsm_read_status()
876 stfsm_wait_seq(fsm); in stfsm_read_status()
881 static int stfsm_write_status(struct stfsm *fsm, uint8_t cmd, in stfsm_write_status() argument
886 dev_dbg(fsm->dev, in stfsm_write_status()
898 stfsm_load_seq(fsm, seq); in stfsm_write_status()
900 stfsm_wait_seq(fsm); in stfsm_write_status()
903 stfsm_wait_busy(fsm); in stfsm_write_status()
928 static bool stfsm_can_handle_soc_reset(struct stfsm *fsm) in stfsm_can_handle_soc_reset() argument
931 if (fsm->reset_signal && fsm->info->flags & FLASH_FLAG_RESET) in stfsm_can_handle_soc_reset()
935 if (fsm->reset_por) in stfsm_can_handle_soc_reset()
943 static void stfsm_prepare_erasesec_seq(struct stfsm *fsm, in stfsm_prepare_erasesec_seq() argument
946 int addr1_cycles = fsm->info->flags & FLASH_FLAG_32BIT_ADDR ? 16 : 8; in stfsm_prepare_erasesec_seq()
957 stfsm_search_seq_rw_configs(struct stfsm *fsm, in stfsm_search_seq_rw_configs() argument
961 int flags = fsm->info->flags; in stfsm_search_seq_rw_configs()
971 static void stfsm_prepare_rw_seq(struct stfsm *fsm, in stfsm_prepare_rw_seq() argument
993 addr1_cycles = (fsm->info->flags & FLASH_FLAG_32BIT_ADDR) ? 16 : 8; in stfsm_prepare_rw_seq()
1039 static int stfsm_search_prepare_rw_seq(struct stfsm *fsm, in stfsm_search_prepare_rw_seq() argument
1045 config = stfsm_search_seq_rw_configs(fsm, cfgs); in stfsm_search_prepare_rw_seq()
1047 dev_err(fsm->dev, "failed to find suitable config\n"); in stfsm_search_prepare_rw_seq()
1051 stfsm_prepare_rw_seq(fsm, seq, config); in stfsm_search_prepare_rw_seq()
1057 static int stfsm_prepare_rwe_seqs_default(struct stfsm *fsm) in stfsm_prepare_rwe_seqs_default() argument
1059 uint32_t flags = fsm->info->flags; in stfsm_prepare_rwe_seqs_default()
1063 ret = stfsm_search_prepare_rw_seq(fsm, &fsm->stfsm_seq_read, in stfsm_prepare_rwe_seqs_default()
1066 dev_err(fsm->dev, in stfsm_prepare_rwe_seqs_default()
1073 ret = stfsm_search_prepare_rw_seq(fsm, &fsm->stfsm_seq_write, in stfsm_prepare_rwe_seqs_default()
1076 dev_err(fsm->dev, in stfsm_prepare_rwe_seqs_default()
1083 stfsm_prepare_erasesec_seq(fsm, &stfsm_seq_erase_sector); in stfsm_prepare_rwe_seqs_default()
1088 static int stfsm_mx25_config(struct stfsm *fsm) in stfsm_mx25_config() argument
1090 uint32_t flags = fsm->info->flags; in stfsm_mx25_config()
1099 ret = stfsm_prepare_rwe_seqs_default(fsm); in stfsm_mx25_config()
1108 stfsm_mx25_en_32bit_addr_seq(&fsm->stfsm_seq_en_32bit_addr); in stfsm_mx25_config()
1110 soc_reset = stfsm_can_handle_soc_reset(fsm); in stfsm_mx25_config()
1111 if (soc_reset || !fsm->booted_from_spi) in stfsm_mx25_config()
1114 stfsm_enter_32bit_addr(fsm, 1); in stfsm_mx25_config()
1119 fsm->configuration = (CFG_READ_TOGGLE_32BIT_ADDR | in stfsm_mx25_config()
1125 stfsm_read_status(fsm, SPINOR_OP_RDSR, &sta, 1); in stfsm_mx25_config()
1126 data_pads = ((fsm->stfsm_seq_read.seq_cfg >> 16) & 0x3) + 1; in stfsm_mx25_config()
1132 stfsm_write_status(fsm, SPINOR_OP_WRSR, sta, 1, 1); in stfsm_mx25_config()
1139 stfsm_write_status(fsm, SPINOR_OP_WRSR, sta, 1, 1); in stfsm_mx25_config()
1146 static int stfsm_n25q_config(struct stfsm *fsm) in stfsm_n25q_config() argument
1148 uint32_t flags = fsm->info->flags; in stfsm_n25q_config()
1155 ret = stfsm_search_prepare_rw_seq(fsm, &fsm->stfsm_seq_read, in stfsm_n25q_config()
1158 ret = stfsm_search_prepare_rw_seq(fsm, &fsm->stfsm_seq_read, in stfsm_n25q_config()
1161 dev_err(fsm->dev, in stfsm_n25q_config()
1168 ret = stfsm_search_prepare_rw_seq(fsm, &fsm->stfsm_seq_write, in stfsm_n25q_config()
1171 dev_err(fsm->dev, in stfsm_n25q_config()
1178 stfsm_prepare_erasesec_seq(fsm, &stfsm_seq_erase_sector); in stfsm_n25q_config()
1182 stfsm_n25q_en_32bit_addr_seq(&fsm->stfsm_seq_en_32bit_addr); in stfsm_n25q_config()
1184 soc_reset = stfsm_can_handle_soc_reset(fsm); in stfsm_n25q_config()
1185 if (soc_reset || !fsm->booted_from_spi) { in stfsm_n25q_config()
1190 stfsm_enter_32bit_addr(fsm, 1); in stfsm_n25q_config()
1196 fsm->configuration = (CFG_WRITE_TOGGLE_32BIT_ADDR | in stfsm_n25q_config()
1206 stfsm_write_status(fsm, N25Q_CMD_WRVCR, vcr, 1, 0); in stfsm_n25q_config()
1224 static void stfsm_s25fl_read_dyb(struct stfsm *fsm, uint32_t offs, uint8_t *dby) in stfsm_s25fl_read_dyb() argument
1251 stfsm_load_seq(fsm, &seq); in stfsm_s25fl_read_dyb()
1253 stfsm_read_fifo(fsm, &tmp, 4); in stfsm_s25fl_read_dyb()
1257 stfsm_wait_seq(fsm); in stfsm_s25fl_read_dyb()
1260 static void stfsm_s25fl_write_dyb(struct stfsm *fsm, uint32_t offs, uint8_t dby) in stfsm_s25fl_write_dyb() argument
1289 stfsm_load_seq(fsm, &seq); in stfsm_s25fl_write_dyb()
1290 stfsm_wait_seq(fsm); in stfsm_s25fl_write_dyb()
1292 stfsm_wait_busy(fsm); in stfsm_s25fl_write_dyb()
1295 static int stfsm_s25fl_clear_status_reg(struct stfsm *fsm) in stfsm_s25fl_clear_status_reg() argument
1319 stfsm_load_seq(fsm, &seq); in stfsm_s25fl_clear_status_reg()
1321 stfsm_wait_seq(fsm); in stfsm_s25fl_clear_status_reg()
1326 static int stfsm_s25fl_config(struct stfsm *fsm) in stfsm_s25fl_config() argument
1328 struct flash_info *info = fsm->info; in stfsm_s25fl_config()
1342 ret = stfsm_search_prepare_rw_seq(fsm, &fsm->stfsm_seq_read, in stfsm_s25fl_config()
1347 ret = stfsm_search_prepare_rw_seq(fsm, &fsm->stfsm_seq_write, in stfsm_s25fl_config()
1356 ret = stfsm_prepare_rwe_seqs_default(fsm); in stfsm_s25fl_config()
1369 stfsm_s25fl_read_dyb(fsm, offs, &dyb); in stfsm_s25fl_config()
1371 stfsm_s25fl_write_dyb(fsm, offs, 0xff); in stfsm_s25fl_config()
1383 stfsm_read_status(fsm, SPINOR_OP_RDSR2, &cr1, 1); in stfsm_s25fl_config()
1384 data_pads = ((fsm->stfsm_seq_read.seq_cfg >> 16) & 0x3) + 1; in stfsm_s25fl_config()
1401 stfsm_read_status(fsm, SPINOR_OP_RDSR, &sr1, 1); in stfsm_s25fl_config()
1403 stfsm_write_status(fsm, SPINOR_OP_WRSR, sta_wr, 2, 1); in stfsm_s25fl_config()
1410 fsm->configuration |= CFG_S25FL_CHECK_ERROR_FLAGS; in stfsm_s25fl_config()
1415 static int stfsm_w25q_config(struct stfsm *fsm) in stfsm_w25q_config() argument
1423 ret = stfsm_prepare_rwe_seqs_default(fsm); in stfsm_w25q_config()
1428 stfsm_read_status(fsm, SPINOR_OP_RDSR2, &sr2, 1); in stfsm_w25q_config()
1429 data_pads = ((fsm->stfsm_seq_read.seq_cfg >> 16) & 0x3) + 1; in stfsm_w25q_config()
1445 stfsm_read_status(fsm, SPINOR_OP_RDSR, &sr1, 1); in stfsm_w25q_config()
1447 stfsm_write_status(fsm, SPINOR_OP_WRSR, sr_wr, 2, 1); in stfsm_w25q_config()
1453 static int stfsm_read(struct stfsm *fsm, uint8_t *buf, uint32_t size, in stfsm_read() argument
1456 struct stfsm_seq *seq = &fsm->stfsm_seq_read; in stfsm_read()
1466 dev_dbg(fsm->dev, "reading %d bytes from 0x%08x\n", size, offset); in stfsm_read()
1469 if (fsm->configuration & CFG_READ_TOGGLE_32BIT_ADDR) in stfsm_read()
1470 stfsm_enter_32bit_addr(fsm, 1); in stfsm_read()
1488 stfsm_load_seq(fsm, seq); in stfsm_read()
1491 stfsm_read_fifo(fsm, (uint32_t *)p, size_lb); in stfsm_read()
1494 stfsm_read_fifo(fsm, tmp, read_mask + 1); in stfsm_read()
1503 stfsm_wait_seq(fsm); in stfsm_read()
1505 stfsm_clear_fifo(fsm); in stfsm_read()
1508 if (fsm->configuration & CFG_READ_TOGGLE_32BIT_ADDR) in stfsm_read()
1509 stfsm_enter_32bit_addr(fsm, 0); in stfsm_read()
1514 static int stfsm_write(struct stfsm *fsm, const uint8_t *buf, in stfsm_write() argument
1517 struct stfsm_seq *seq = &fsm->stfsm_seq_write; in stfsm_write()
1530 dev_dbg(fsm->dev, "writing %d bytes to 0x%08x\n", size, offset); in stfsm_write()
1533 if (fsm->configuration & CFG_WRITE_TOGGLE_32BIT_ADDR) in stfsm_write()
1534 stfsm_enter_32bit_addr(fsm, 1); in stfsm_write()
1560 writel(0x00040000, fsm->base + SPI_FAST_SEQ_CFG); in stfsm_write()
1566 if (fsm->fifo_dir_delay == 0) in stfsm_write()
1567 readl(fsm->base + SPI_FAST_SEQ_CFG); in stfsm_write()
1569 udelay(fsm->fifo_dir_delay); in stfsm_write()
1574 stfsm_write_fifo(fsm, (uint32_t *)p, size_lb); in stfsm_write()
1584 stfsm_write_fifo(fsm, tmp, write_mask + 1); in stfsm_write()
1588 stfsm_load_seq(fsm, seq); in stfsm_write()
1591 stfsm_wait_seq(fsm); in stfsm_write()
1594 ret = stfsm_wait_busy(fsm); in stfsm_write()
1595 if (ret && fsm->configuration & CFG_S25FL_CHECK_ERROR_FLAGS) in stfsm_write()
1596 stfsm_s25fl_clear_status_reg(fsm); in stfsm_write()
1599 if (fsm->configuration & CFG_WRITE_TOGGLE_32BIT_ADDR) in stfsm_write()
1600 stfsm_enter_32bit_addr(fsm, 0); in stfsm_write()
1612 struct stfsm *fsm = dev_get_drvdata(mtd->dev.parent); in stfsm_mtd_read() local
1615 dev_dbg(fsm->dev, "%s from 0x%08x, len %zd\n", in stfsm_mtd_read()
1618 mutex_lock(&fsm->lock); in stfsm_mtd_read()
1623 stfsm_read(fsm, buf, bytes, from); in stfsm_mtd_read()
1632 mutex_unlock(&fsm->lock); in stfsm_mtd_read()
1637 static int stfsm_erase_sector(struct stfsm *fsm, uint32_t offset) in stfsm_erase_sector() argument
1642 dev_dbg(fsm->dev, "erasing sector at 0x%08x\n", offset); in stfsm_erase_sector()
1645 if (fsm->configuration & CFG_ERASESEC_TOGGLE_32BIT_ADDR) in stfsm_erase_sector()
1646 stfsm_enter_32bit_addr(fsm, 1); in stfsm_erase_sector()
1651 stfsm_load_seq(fsm, seq); in stfsm_erase_sector()
1653 stfsm_wait_seq(fsm); in stfsm_erase_sector()
1656 ret = stfsm_wait_busy(fsm); in stfsm_erase_sector()
1657 if (ret && fsm->configuration & CFG_S25FL_CHECK_ERROR_FLAGS) in stfsm_erase_sector()
1658 stfsm_s25fl_clear_status_reg(fsm); in stfsm_erase_sector()
1661 if (fsm->configuration & CFG_ERASESEC_TOGGLE_32BIT_ADDR) in stfsm_erase_sector()
1662 stfsm_enter_32bit_addr(fsm, 0); in stfsm_erase_sector()
1667 static int stfsm_erase_chip(struct stfsm *fsm) in stfsm_erase_chip() argument
1671 dev_dbg(fsm->dev, "erasing chip\n"); in stfsm_erase_chip()
1673 stfsm_load_seq(fsm, seq); in stfsm_erase_chip()
1675 stfsm_wait_seq(fsm); in stfsm_erase_chip()
1677 return stfsm_wait_busy(fsm); in stfsm_erase_chip()
1688 struct stfsm *fsm = dev_get_drvdata(mtd->dev.parent); in stfsm_mtd_write() local
1695 dev_dbg(fsm->dev, "%s to 0x%08x, len %zd\n", __func__, (u32)to, len); in stfsm_mtd_write()
1700 mutex_lock(&fsm->lock); in stfsm_mtd_write()
1706 ret = stfsm_write(fsm, b, bytes, to); in stfsm_mtd_write()
1722 mutex_unlock(&fsm->lock); in stfsm_mtd_write()
1733 struct stfsm *fsm = dev_get_drvdata(mtd->dev.parent); in stfsm_mtd_erase() local
1737 dev_dbg(fsm->dev, "%s at 0x%llx, len %lld\n", __func__, in stfsm_mtd_erase()
1743 mutex_lock(&fsm->lock); in stfsm_mtd_erase()
1747 ret = stfsm_erase_chip(fsm); in stfsm_mtd_erase()
1752 ret = stfsm_erase_sector(fsm, addr); in stfsm_mtd_erase()
1761 mutex_unlock(&fsm->lock); in stfsm_mtd_erase()
1770 mutex_unlock(&fsm->lock); in stfsm_mtd_erase()
1775 static void stfsm_read_jedec(struct stfsm *fsm, uint8_t *jedec) in stfsm_read_jedec() argument
1780 stfsm_load_seq(fsm, seq); in stfsm_read_jedec()
1782 stfsm_read_fifo(fsm, tmp, 8); in stfsm_read_jedec()
1786 stfsm_wait_seq(fsm); in stfsm_read_jedec()
1789 static struct flash_info *stfsm_jedec_probe(struct stfsm *fsm) in stfsm_jedec_probe() argument
1796 stfsm_read_jedec(fsm, id); in stfsm_jedec_probe()
1806 dev_dbg(fsm->dev, "JEDEC = 0x%08x [%02x %02x %02x %02x %02x]\n", in stfsm_jedec_probe()
1816 dev_err(fsm->dev, "Unrecognized JEDEC id %06x\n", jedec); in stfsm_jedec_probe()
1821 static int stfsm_set_mode(struct stfsm *fsm, uint32_t mode) in stfsm_set_mode() argument
1827 ret = readl(fsm->base + SPI_STA_MODE_CHANGE); in stfsm_set_mode()
1836 writel(mode, fsm->base + SPI_MODESELECT); in stfsm_set_mode()
1841 static void stfsm_set_freq(struct stfsm *fsm, uint32_t spi_freq) in stfsm_set_freq() argument
1866 fsm->fifo_dir_delay = 0; in stfsm_set_freq()
1868 fsm->fifo_dir_delay = 1; in stfsm_set_freq()
1870 fsm->fifo_dir_delay = DIV_ROUND_UP(clk_div, 10); in stfsm_set_freq()
1872 dev_dbg(fsm->dev, "emi_clk = %uHZ, spi_freq = %uHZ, clk_div = %u\n", in stfsm_set_freq()
1875 writel(clk_div, fsm->base + SPI_CLOCKDIV); in stfsm_set_freq()
1878 static int stfsm_init(struct stfsm *fsm) in stfsm_init() argument
1883 writel(SEQ_CFG_SWRESET, fsm->base + SPI_FAST_SEQ_CFG); in stfsm_init()
1885 writel(0, fsm->base + SPI_FAST_SEQ_CFG); in stfsm_init()
1888 stfsm_set_freq(fsm, STFSM_FLASH_SAFE_FREQ); in stfsm_init()
1891 ret = stfsm_set_mode(fsm, SPI_MODESELECT_FSM); in stfsm_init()
1900 fsm->base + SPI_CONFIGDATA); in stfsm_init()
1901 writel(STFSM_DEFAULT_WR_TIME, fsm->base + SPI_STATUS_WR_TIME_REG); in stfsm_init()
1908 writel(0x00000001, fsm->base + SPI_PROGRAM_ERASE_TIME); in stfsm_init()
1911 stfsm_clear_fifo(fsm); in stfsm_init()
1918 struct stfsm *fsm = platform_get_drvdata(pdev); in stfsm_fetch_platform_configs() local
1927 fsm->booted_from_spi = true; in stfsm_fetch_platform_configs()
1933 fsm->reset_signal = of_property_read_bool(np, "st,reset-signal"); in stfsm_fetch_platform_configs()
1935 fsm->reset_por = of_property_read_bool(np, "st,reset-por"); in stfsm_fetch_platform_configs()
1952 fsm->booted_from_spi = false; in stfsm_fetch_platform_configs()
1967 struct stfsm *fsm; in stfsm_probe() local
1976 fsm = devm_kzalloc(&pdev->dev, sizeof(*fsm), GFP_KERNEL); in stfsm_probe()
1977 if (!fsm) in stfsm_probe()
1980 fsm->dev = &pdev->dev; in stfsm_probe()
1982 platform_set_drvdata(pdev, fsm); in stfsm_probe()
1990 fsm->base = devm_ioremap_resource(&pdev->dev, res); in stfsm_probe()
1991 if (IS_ERR(fsm->base)) { in stfsm_probe()
1994 return PTR_ERR(fsm->base); in stfsm_probe()
1997 mutex_init(&fsm->lock); in stfsm_probe()
1999 ret = stfsm_init(fsm); in stfsm_probe()
2008 info = stfsm_jedec_probe(fsm); in stfsm_probe()
2011 fsm->info = info; in stfsm_probe()
2022 ret = info->config(fsm); in stfsm_probe()
2026 ret = stfsm_prepare_rwe_seqs_default(fsm); in stfsm_probe()
2031 fsm->mtd.name = info->name; in stfsm_probe()
2032 fsm->mtd.dev.parent = &pdev->dev; in stfsm_probe()
2033 fsm->mtd.type = MTD_NORFLASH; in stfsm_probe()
2034 fsm->mtd.writesize = 4; in stfsm_probe()
2035 fsm->mtd.writebufsize = fsm->mtd.writesize; in stfsm_probe()
2036 fsm->mtd.flags = MTD_CAP_NORFLASH; in stfsm_probe()
2037 fsm->mtd.size = info->sector_size * info->n_sectors; in stfsm_probe()
2038 fsm->mtd.erasesize = info->sector_size; in stfsm_probe()
2040 fsm->mtd._read = stfsm_mtd_read; in stfsm_probe()
2041 fsm->mtd._write = stfsm_mtd_write; in stfsm_probe()
2042 fsm->mtd._erase = stfsm_mtd_erase; in stfsm_probe()
2048 (long long)fsm->mtd.size, (long long)(fsm->mtd.size >> 20), in stfsm_probe()
2049 fsm->mtd.erasesize, (fsm->mtd.erasesize >> 10)); in stfsm_probe()
2051 return mtd_device_parse_register(&fsm->mtd, NULL, &ppdata, NULL, 0); in stfsm_probe()
2056 struct stfsm *fsm = platform_get_drvdata(pdev); in stfsm_remove() local
2058 return mtd_device_unregister(&fsm->mtd); in stfsm_remove()