diff --git a/include/zephyr/usb/class/usbd_msc.h b/include/zephyr/usb/class/usbd_msc.h index 9b0b1322db0e5c..e78990388fc4ea 100644 --- a/include/zephyr/usb/class/usbd_msc.h +++ b/include/zephyr/usb/class/usbd_msc.h @@ -37,17 +37,18 @@ struct usbd_msc_lun { * Up to `CONFIG_USBD_MSC_LUNS_PER_INSTANCE` disks can be registered on single * USB MSC instance. Currently only one USB MSC instance is supported. * + * @param id Identifier by which the linker sorts registered LUNs * @param disk_name Disk name as used in @ref disk_access_interface * @param t10_vendor T10 Vendor Indetification * @param t10_product T10 Product Identification * @param t10_revision T10 Product Revision Level */ -#define USBD_DEFINE_MSC_LUN(disk_name, t10_vendor, t10_product, t10_revision) \ - STRUCT_SECTION_ITERABLE(usbd_msc_lun, usbd_msc_lun_##disk_name) = { \ - .disk = STRINGIFY(disk_name), \ - .vendor = t10_vendor, \ - .product = t10_product, \ - .revision = t10_revision, \ +#define USBD_DEFINE_MSC_LUN(id, disk_name, t10_vendor, t10_product, t10_revision) \ + static const STRUCT_SECTION_ITERABLE(usbd_msc_lun, usbd_msc_lun_##id) = { \ + .disk = disk_name, \ + .vendor = t10_vendor, \ + .product = t10_product, \ + .revision = t10_revision, \ } /** diff --git a/samples/subsys/usb/mass/src/main.c b/samples/subsys/usb/mass/src/main.c index 4cdec0120b2492..df90560d8353cc 100644 --- a/samples/subsys/usb/mass/src/main.c +++ b/samples/subsys/usb/mass/src/main.c @@ -45,15 +45,15 @@ static struct fs_mount_t fs_mnt; static struct usbd_context *sample_usbd; #if CONFIG_DISK_DRIVER_RAM -USBD_DEFINE_MSC_LUN(RAM, "Zephyr", "RAMDisk", "0.00"); +USBD_DEFINE_MSC_LUN(ram, "RAM", "Zephyr", "RAMDisk", "0.00"); #endif #if CONFIG_DISK_DRIVER_FLASH -USBD_DEFINE_MSC_LUN(NAND, "Zephyr", "FlashDisk", "0.00"); +USBD_DEFINE_MSC_LUN(nand, "NAND", "Zephyr", "FlashDisk", "0.00"); #endif #if CONFIG_DISK_DRIVER_SDMMC -USBD_DEFINE_MSC_LUN(SD, "Zephyr", "SD", "0.00"); +USBD_DEFINE_MSC_LUN(sd, "SD", "Zephyr", "SD", "0.00"); #endif static int enable_usb_device_next(void)