From 570fba9463e296de3f612555ef573fd49198e3c2 Mon Sep 17 00:00:00 2001 From: Brendan Le Foll Date: Tue, 11 Aug 2015 11:54:11 +0100 Subject: [PATCH] mraa.c: usb MRAA_UNKNOWN_PLATFORM is not considered initialisation Signed-off-by: Brendan Le Foll --- src/mraa.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mraa.c b/src/mraa.c index 0a7bbd6..fdb1373 100644 --- a/src/mraa.c +++ b/src/mraa.c @@ -131,8 +131,10 @@ mraa_init() // Now detect sub platform if (plat != NULL) { mraa_platform_t usb_platform_type = mraa_usb_platform_extender(plat); - if (plat->platform_type == MRAA_UNKNOWN_PLATFORM) { + if (plat->platform_type == MRAA_UNKNOWN_PLATFORM && usb_platform_type != MRAA_UNKNOWN_PLATFORM) { plat->platform_type = usb_platform_type; + } else { + return MRAA_ERROR_PLATFORM_NOT_INITIALISED; } } if (plat == NULL) {