From 270285217d31fc359cd5600ed0956b69b3b46cee Mon Sep 17 00:00:00 2001 From: armink Date: Fri, 14 Oct 2016 22:51:18 +0800 Subject: [PATCH] [DeviceDrivers]Make sure rt_sfud_flash_probe device must be SPI device. --- components/drivers/spi/spi_flash_sfud.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/drivers/spi/spi_flash_sfud.c b/components/drivers/spi/spi_flash_sfud.c index 427673378..d70c9f845 100644 --- a/components/drivers/spi/spi_flash_sfud.c +++ b/components/drivers/spi/spi_flash_sfud.c @@ -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; } -- GitLab