api/platform_name: Change return when null platform
authorThomas Ingleby <thomas.c.ingleby@intel.com>
Wed, 21 Jan 2015 15:39:29 +0000 (15:39 +0000)
committerThomas Ingleby <thomas.c.ingleby@intel.com>
Wed, 21 Jan 2015 15:39:29 +0000 (15:39 +0000)
Easier to error check against

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
api/mraa/common.h
api/mraa/common.hpp
src/mraa.c

index a348403..ccdcef9 100644 (file)
@@ -237,7 +237,7 @@ unsigned int mraa_adc_supported_bits();
 mraa_result_t mraa_set_log_level(int level);
 
 /**
- * Return the Platform's Name, If no platform detected return "Unknown"
+ * Return the Platform's Name, If no platform detected return NULL
  *
  * @return platform name
  */
index c51cf22..a144b13 100644 (file)
@@ -117,7 +117,7 @@ inline unsigned int adcSupportedBits()
 }
 
 /**
- * Return Platform Name. "Unknown" if no platform inited.
+ * Return Platform Name. Returns NULL if no platform inited.
  *
  * @return platform name
  */
index d1d2598..7397bab 100644 (file)
@@ -303,8 +303,9 @@ mraa_adc_supported_bits()
 char*
 mraa_get_platform_name()
 {
-    if (plat == NULL)
-        return "Unknown";
+    if (plat == NULL) {
+        return NULL;
+    }
     return (char*) plat->platform_name;
 }