mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
treewide: mtd_default_get_dev() -> mtd_dev_get()
This commit is contained in:
parent
63cd55cc7b
commit
c2f93c05f1
@ -25,7 +25,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "usb/usbus.h"
|
#include "usb/usbus.h"
|
||||||
#include "usb/usbus/msc/scsi.h"
|
#include "usb/usbus/msc/scsi.h"
|
||||||
#include "mtd_default.h"
|
#include "mtd.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -374,7 +374,7 @@ static void _init(usbus_t *usbus, usbus_handler_t *handler)
|
|||||||
/* Auto-configure all MTD devices */
|
/* Auto-configure all MTD devices */
|
||||||
if (CONFIG_USBUS_MSC_AUTO_MTD) {
|
if (CONFIG_USBUS_MSC_AUTO_MTD) {
|
||||||
for (unsigned i = 0; i < MTD_NUMOF; i++) {
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "od.h"
|
#include "od.h"
|
||||||
#include "mtd_default.h"
|
#include "mtd.h"
|
||||||
#include "shell.h"
|
#include "shell.h"
|
||||||
#include "board.h"
|
#include "board.h"
|
||||||
#include "macros/units.h"
|
#include "macros/units.h"
|
||||||
@ -45,7 +45,7 @@ static mtd_dev_t *_get_dev(int argc, char **argv)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return mtd_default_get_dev(idx);
|
return mtd_dev_get(idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint64_t _get_size(mtd_dev_t *dev)
|
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) {
|
for (unsigned i = 0; i < MTD_NUMOF; ++i) {
|
||||||
printf(" -=[ MTD_%d ]=-\n", i);
|
printf(" -=[ MTD_%d ]=-\n", i);
|
||||||
_print_info(mtd_default_get_dev(i));
|
_print_info(mtd_dev_get(i));
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -453,7 +453,7 @@ int main(void)
|
|||||||
for (unsigned i = 0; i < MTD_NUMOF; ++i) {
|
for (unsigned i = 0; i < MTD_NUMOF; ++i) {
|
||||||
printf("init MTD_%d… ", 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);
|
int res = mtd_init(dev);
|
||||||
if (res) {
|
if (res) {
|
||||||
printf("error: %d\n", res);
|
printf("error: %d\n", res);
|
||||||
|
@ -48,7 +48,7 @@ MTD_EMULATED_DEV(0, SECTOR_COUNT, PAGES_PER_SECTOR, PAGE_SIZE);
|
|||||||
|
|
||||||
#endif /* MODULE_MTD_EMULATED */
|
#endif /* MODULE_MTD_EMULATED */
|
||||||
|
|
||||||
#include "mtd_default.h"
|
#include "mtd.h"
|
||||||
#include "shell.h"
|
#include "shell.h"
|
||||||
#include "usb/usbus.h"
|
#include "usb/usbus.h"
|
||||||
#include "usb/usbus/msc.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");
|
puts("error: invalid MTD device specified");
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
mtd_dev = mtd_default_get_dev(dev);
|
mtd_dev = mtd_dev_get(dev);
|
||||||
ret = usbus_msc_add_lun(usbus, mtd_dev);
|
ret = usbus_msc_add_lun(usbus, mtd_dev);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
printf("Cannot add LUN device (error:%d %s)\n", ret, strerror(-ret));
|
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");
|
puts("error: invalid MTD device specified");
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
mtd_dev = mtd_default_get_dev(dev);
|
mtd_dev = mtd_dev_get(dev);
|
||||||
ret = usbus_msc_remove_lun(usbus, mtd_dev);
|
ret = usbus_msc_remove_lun(usbus, mtd_dev);
|
||||||
if (ret == -EAGAIN) {
|
if (ret == -EAGAIN) {
|
||||||
printf("MTD device was not registered\n");
|
printf("MTD device was not registered\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user