[DeviceDrivers]Make sure rt_sfud_flash_probe device must be SPI device.

This commit is contained in:
armink 2016-10-14 22:51:18 +08:00
parent a4bc38ad6b
commit 270285217d
1 changed files with 1 additions and 1 deletions

View File

@ -264,7 +264,7 @@ rt_spi_flash_device_t rt_sfud_flash_probe(const char *spi_flash_dev_name, const
{
/* RT-Thread SPI device initialize */
rtt_dev->rt_spi_device = (struct rt_spi_device *) rt_device_find(spi_dev_name);
if (rtt_dev->rt_spi_device == RT_NULL) {
if (rtt_dev->rt_spi_device == RT_NULL || rtt_dev->rt_spi_device->parent.type != RT_Device_Class_SPIDevice) {
rt_kprintf("ERROR: SPI device %s not found!\n", spi_dev_name);
goto error;
}