api/platform_name: Change return when null platform
Easier to error check against Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
This commit is contained in:
@@ -237,7 +237,7 @@ unsigned int mraa_adc_supported_bits();
|
|||||||
mraa_result_t mraa_set_log_level(int level);
|
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
|
* @return platform name
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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
|
* @return platform name
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -303,8 +303,9 @@ mraa_adc_supported_bits()
|
|||||||
char*
|
char*
|
||||||
mraa_get_platform_name()
|
mraa_get_platform_name()
|
||||||
{
|
{
|
||||||
if (plat == NULL)
|
if (plat == NULL) {
|
||||||
return "Unknown";
|
return NULL;
|
||||||
|
}
|
||||||
return (char*) plat->platform_name;
|
return (char*) plat->platform_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user