Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mtd/*: drop .write() if .write_page() is implemented #15380

Merged
merged 11 commits into from
Dec 13, 2023
Prev Previous commit
Next Next commit
tests/mtd_mapper: drop .write() function
  • Loading branch information
benpicco committed Dec 13, 2023
commit 3b489cf2f56abc3845b4bce494872aa73f4039e2
17 changes: 0 additions & 17 deletions tests/drivers/mtd_mapper/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,22 +91,6 @@ static int _read_page(mtd_dev_t *dev, void *buff, uint32_t page, uint32_t offset
return size;
}

static int _write(mtd_dev_t *dev, const void *buff, uint32_t addr,
uint32_t size)
{
(void)dev;

if (addr + size > sizeof(_dummy_memory)) {
return -EOVERFLOW;
}
if (size > PAGE_SIZE) {
return -EOVERFLOW;
}
memcpy(_dummy_memory + addr, buff, size);

return 0;
}

static int _write_page(mtd_dev_t *dev, const void *buff, uint32_t page, uint32_t offset, uint32_t size)
{
uint32_t addr = page * dev->page_size + offset;
Expand Down Expand Up @@ -168,7 +152,6 @@ static int _power(mtd_dev_t *dev, enum mtd_power_state power)
static const mtd_desc_t driver = {
.init = _init,
.read = _read,
.write = _write,
.erase = _erase,
.power = _power,
.read_page = _read_page,
Expand Down