Skip to content

Commit

Permalink
samples: subsys: usb: dfu: Fix build error for intel_s1000
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
SavinayDharmappa authored and nashif committed Dec 30, 2018
1 parent 33f1951 commit b9b8daa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions subsys/dfu/boot/mcuboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,11 @@ int boot_erase_img_bank(u32_t bank_offset)
static int boot_init(struct device *dev)
{
ARG_UNUSED(dev);
#if defined(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) {
return -ENODEV;
}
Expand Down
4 changes: 4 additions & 0 deletions subsys/usb/class/usb_dfu.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,11 @@ static int usb_dfu_init(struct device *dev)

ARG_UNUSED(dev);

#if defined(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) {
LOG_ERR("Flash device not found\n");
return -ENODEV;
Expand Down

0 comments on commit b9b8daa

Please sign in to comment.