samples: subsys: usb: dfu: Fix build error for intel_s1000
intel_s1000 uses DT_SPI_NOR_DRV_NAME instead of DT_FLASH_DEV_NAME for device binding of flash device. Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
This commit is contained in:
parent
33f1951c9d
commit
b9b8daa3bc
2 changed files with 8 additions and 0 deletions
|
@ -497,7 +497,11 @@ int boot_erase_img_bank(u32_t bank_offset)
|
||||||
static int boot_init(struct device *dev)
|
static int boot_init(struct device *dev)
|
||||||
{
|
{
|
||||||
ARG_UNUSED(dev);
|
ARG_UNUSED(dev);
|
||||||
|
#if defined(DT_FLASH_DEV_NAME)
|
||||||
flash_dev = device_get_binding(DT_FLASH_DEV_NAME);
|
flash_dev = device_get_binding(DT_FLASH_DEV_NAME);
|
||||||
|
#elif defined(DT_SPI_NOR_DRV_NAME)
|
||||||
|
flash_dev = device_get_binding(DT_SPI_NOR_DRV_NAME);
|
||||||
|
#endif
|
||||||
if (!flash_dev) {
|
if (!flash_dev) {
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
@ -685,7 +685,11 @@ static int usb_dfu_init(struct device *dev)
|
||||||
|
|
||||||
ARG_UNUSED(dev);
|
ARG_UNUSED(dev);
|
||||||
|
|
||||||
|
#if defined(DT_FLASH_DEV_NAME)
|
||||||
dfu_data.flash_dev = device_get_binding(DT_FLASH_DEV_NAME);
|
dfu_data.flash_dev = device_get_binding(DT_FLASH_DEV_NAME);
|
||||||
|
#elif defined(DT_SPI_NOR_DRV_NAME)
|
||||||
|
dfu_data.flash_dev = device_get_binding(DT_SPI_NOR_DRV_NAME);
|
||||||
|
#endif
|
||||||
if (!dfu_data.flash_dev) {
|
if (!dfu_data.flash_dev) {
|
||||||
LOG_ERR("Flash device not found\n");
|
LOG_ERR("Flash device not found\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue