1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-28 23:29:45 +01:00

treewide: mtd_default_get_dev() -> mtd_dev_get()

This commit is contained in:
Benjamin Valentin 2023-11-10 19:24:18 +01:00
parent 63cd55cc7b
commit c2f93c05f1
4 changed files with 9 additions and 9 deletions

View File

@ -25,7 +25,7 @@
#include <stdint.h>
#include "usb/usbus.h"
#include "usb/usbus/msc/scsi.h"
#include "mtd_default.h"
#include "mtd.h"
#ifdef __cplusplus
extern "C" {

View File

@ -374,7 +374,7 @@ static void _init(usbus_t *usbus, usbus_handler_t *handler)
/* Auto-configure all MTD devices */
if (CONFIG_USBUS_MSC_AUTO_MTD) {
for (unsigned i = 0; i < MTD_NUMOF; i++) {
usbus_msc_add_lun(usbus, mtd_default_get_dev(i));
usbus_msc_add_lun(usbus, mtd_dev_get(i));
}
}
}

View File

@ -25,7 +25,7 @@
#include <string.h>
#include "od.h"
#include "mtd_default.h"
#include "mtd.h"
#include "shell.h"
#include "board.h"
#include "macros/units.h"
@ -45,7 +45,7 @@ static mtd_dev_t *_get_dev(int argc, char **argv)
return NULL;
}
return mtd_default_get_dev(idx);
return mtd_dev_get(idx);
}
static uint64_t _get_size(mtd_dev_t *dev)
@ -283,7 +283,7 @@ static int cmd_info(int argc, char **argv)
for (unsigned i = 0; i < MTD_NUMOF; ++i) {
printf(" -=[ MTD_%d ]=-\n", i);
_print_info(mtd_default_get_dev(i));
_print_info(mtd_dev_get(i));
}
return 0;
}
@ -453,7 +453,7 @@ int main(void)
for (unsigned i = 0; i < MTD_NUMOF; ++i) {
printf("init MTD_%d… ", i);
mtd_dev_t *dev = mtd_default_get_dev(i);
mtd_dev_t *dev = mtd_dev_get(i);
int res = mtd_init(dev);
if (res) {
printf("error: %d\n", res);

View File

@ -48,7 +48,7 @@ MTD_EMULATED_DEV(0, SECTOR_COUNT, PAGES_PER_SECTOR, PAGE_SIZE);
#endif /* MODULE_MTD_EMULATED */
#include "mtd_default.h"
#include "mtd.h"
#include "shell.h"
#include "usb/usbus.h"
#include "usb/usbus/msc.h"
@ -76,7 +76,7 @@ static int _cmd_add_lun(int argc, char **argv)
puts("error: invalid MTD device specified");
return -2;
}
mtd_dev = mtd_default_get_dev(dev);
mtd_dev = mtd_dev_get(dev);
ret = usbus_msc_add_lun(usbus, mtd_dev);
if (ret != 0) {
printf("Cannot add LUN device (error:%d %s)\n", ret, strerror(-ret));
@ -104,7 +104,7 @@ static int _cmd_remove_lun(int argc, char **argv)
puts("error: invalid MTD device specified");
return -2;
}
mtd_dev = mtd_default_get_dev(dev);
mtd_dev = mtd_dev_get(dev);
ret = usbus_msc_remove_lun(usbus, mtd_dev);
if (ret == -EAGAIN) {
printf("MTD device was not registered\n");