diff --git a/drivers/include/mtd.h b/drivers/include/mtd.h index b7bef30f57f7e..cfa3bd09ab3d2 100644 --- a/drivers/include/mtd.h +++ b/drivers/include/mtd.h @@ -250,25 +250,6 @@ struct mtd_desc { uint32_t offset, uint32_t size); - /** - * @brief Write to the Memory Technology Device (MTD) - * - * @p addr + @p size must be inside a page boundary. @p addr can be anywhere - * but the buffer cannot overlap two pages. - * - * @param[in] dev Pointer to the selected driver - * @param[in] buff Pointer to the data to be written - * @param[in] addr Starting address - * @param[in] size Number of bytes - * - * @retval 0 on success - * @retval <0 value on error - */ - int (*write)(mtd_dev_t *dev, - const void *buff, - uint32_t addr, - uint32_t size); - /** * @brief Write to the Memory Technology Device (MTD) using * pagewise addressing. diff --git a/drivers/mtd/mtd.c b/drivers/mtd/mtd.c index f9a6bec4b47bb..200701ed6b14c 100644 --- a/drivers/mtd/mtd.c +++ b/drivers/mtd/mtd.c @@ -169,14 +169,6 @@ int mtd_write(mtd_dev_t *mtd, const void *src, uint32_t addr, uint32_t count) return -ENODEV; } - if (out_of_bounds(mtd, 0, addr, count)) { - return -EOVERFLOW; - } - - if (mtd->driver->write) { - return mtd->driver->write(mtd, src, addr, count); - } - /* page size is always a power of two */ const uint32_t page_shift = bitarithm_msb(mtd->page_size); const uint32_t page_mask = mtd->page_size - 1; @@ -296,15 +288,6 @@ int mtd_write_page_raw(mtd_dev_t *mtd, const void *src, uint32_t page, uint32_t return -EOVERFLOW; } - if (mtd->driver->write_page == NULL) { - /* TODO: remove when all backends implement write_page */ - if (mtd->driver->write) { - return mtd->driver->write(mtd, src, mtd->page_size * page + offset, count); - } else { - return -ENOTSUP; - } - } - /* Implementation assumes page size is <= INT_MAX and a power of two. */ /* We didn't find hardware yet where this is not true. */ assert(mtd->page_size <= INT_MAX);