diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/common/disk.c | 9 | ||||
-rw-r--r-- | firmware/common/disk.h | 5 |
2 files changed, 7 insertions, 7 deletions
diff --git a/firmware/common/disk.c b/firmware/common/disk.c index 9572f115e5..b662072d5f 100644 --- a/firmware/common/disk.c +++ b/firmware/common/disk.c @@ -16,6 +16,7 @@ * KIND, either express or implied. * ****************************************************************************/ +#include <stdio.h> #include "ata.h" #include "debug.h" #include "disk.h" @@ -38,9 +39,9 @@ (array[pos] | (array[pos+1] << 8 ) | \ (array[pos+2] << 16 ) | (array[pos+3] << 24 )) -struct partinfo part[8]; +static struct partinfo part[8]; -int disk_init(void) +struct partinfo* disk_init(void) { int i; unsigned char sector[512]; @@ -51,7 +52,7 @@ int disk_init(void) if ( (sector[510] != 0x55) || (sector[511] != 0xaa)) { DEBUGF("Bad boot sector signature\n"); - return -1; + return NULL; } /* parse partitions */ @@ -70,5 +71,5 @@ int disk_init(void) } } - return 0; + return part; } diff --git a/firmware/common/disk.h b/firmware/common/disk.h index 1e95c73c6b..8a78386c6c 100644 --- a/firmware/common/disk.h +++ b/firmware/common/disk.h @@ -25,8 +25,7 @@ struct partinfo { unsigned char type; }; -extern struct partinfo part[8]; - -int disk_init(void); +/* returns a pointer to an array of 8 partinfo structs */ +struct partinfo* disk_init(void); #endif |