Remove deprecated IO return definitions

Patch 7e26fe1f deprecates IO specific return definitions in favour
of standard errno codes. This patch removes those definitions
and its usage from the IO framework, IO drivers and IO platform
layer. Following this patch, standard errno codes must be used
when checking the return value of an IO function.

Change-Id: Id6e0e9d0a7daf15a81ec598cf74de83d5768650f
diff --git a/drivers/io/io_semihosting.c b/drivers/io/io_semihosting.c
index 8e62be1..63d0f68 100644
--- a/drivers/io/io_semihosting.c
+++ b/drivers/io/io_semihosting.c
@@ -84,10 +84,9 @@
 static int sh_dev_open(const uintptr_t dev_spec __unused,
 		io_dev_info_t **dev_info)
 {
-	int result = IO_SUCCESS;
 	assert(dev_info != NULL);
 	*dev_info = (io_dev_info_t *)&sh_dev_info; /* cast away const */
-	return result;
+	return 0;
 }
 
 
@@ -95,7 +94,7 @@
 static int sh_file_open(io_dev_info_t *dev_info __attribute__((unused)),
 		const uintptr_t spec, io_entity_t *entity)
 {
-	int result = IO_FAIL;
+	int result = -ENOENT;
 	long sh_result = -1;
 	const io_file_spec_t *file_spec = (const io_file_spec_t *)spec;
 
@@ -106,9 +105,7 @@
 
 	if (sh_result > 0) {
 		entity->info = (uintptr_t)sh_result;
-		result = IO_SUCCESS;
-	} else {
-		result = IO_FAIL;
+		result = 0;
 	}
 	return result;
 }
@@ -117,7 +114,6 @@
 /* Seek to a particular file offset on the semi-hosting device */
 static int sh_file_seek(io_entity_t *entity, int mode, ssize_t offset)
 {
-	int result = IO_FAIL;
 	long file_handle, sh_result;
 
 	assert(entity != NULL);
@@ -126,16 +122,14 @@
 
 	sh_result = semihosting_file_seek(file_handle, offset);
 
-	result = (sh_result == 0) ? IO_SUCCESS : IO_FAIL;
-
-	return result;
+	return (sh_result == 0) ? 0 : -ENOENT;
 }
 
 
 /* Return the size of a file on the semi-hosting device */
 static int sh_file_len(io_entity_t *entity, size_t *length)
 {
-	int result = IO_FAIL;
+	int result = -ENOENT;
 
 	assert(entity != NULL);
 	assert(length != NULL);
@@ -144,7 +138,7 @@
 	long sh_result = semihosting_file_length(sh_handle);
 
 	if (sh_result >= 0) {
-		result = IO_SUCCESS;
+		result = 0;
 		*length = (size_t)sh_result;
 	}
 
@@ -156,7 +150,7 @@
 static int sh_file_read(io_entity_t *entity, uintptr_t buffer, size_t length,
 		size_t *length_read)
 {
-	int result = IO_FAIL;
+	int result = -ENOENT;
 	long sh_result = -1;
 	size_t bytes = length;
 	long file_handle;
@@ -171,9 +165,8 @@
 
 	if (sh_result >= 0) {
 		*length_read = (bytes != length) ? bytes : length;
-		result = IO_SUCCESS;
-	} else
-		result = IO_FAIL;
+		result = 0;
+	}
 
 	return result;
 }
@@ -197,14 +190,13 @@
 
 	*length_written = length - bytes;
 
-	return (sh_result == 0) ? IO_SUCCESS : IO_FAIL;
+	return (sh_result == 0) ? 0 : -ENOENT;
 }
 
 
 /* Close a file on the semi-hosting device */
 static int sh_file_close(io_entity_t *entity)
 {
-	int result = IO_FAIL;
 	long sh_result = -1;
 	long file_handle;
 
@@ -214,9 +206,7 @@
 
 	sh_result = semihosting_file_close(file_handle);
 
-	result = (sh_result >= 0) ? IO_SUCCESS : IO_FAIL;
-
-	return result;
+	return (sh_result >= 0) ? 0 : -ENOENT;
 }
 
 
@@ -225,11 +215,11 @@
 /* Register the semi-hosting driver with the IO abstraction */
 int register_io_dev_sh(const io_dev_connector_t **dev_con)
 {
-	int result = IO_FAIL;
+	int result;
 	assert(dev_con != NULL);
 
 	result = io_register_device(&sh_dev_info);
-	if (result == IO_SUCCESS)
+	if (result == 0)
 		*dev_con = &sh_dev_connector;
 
 	return result;