diff options
Diffstat (limited to 'firmware/common')
-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 @@ | |||
16 | * KIND, either express or implied. | 16 | * KIND, either express or implied. |
17 | * | 17 | * |
18 | ****************************************************************************/ | 18 | ****************************************************************************/ |
19 | #include <stdio.h> | ||
19 | #include "ata.h" | 20 | #include "ata.h" |
20 | #include "debug.h" | 21 | #include "debug.h" |
21 | #include "disk.h" | 22 | #include "disk.h" |
@@ -38,9 +39,9 @@ | |||
38 | (array[pos] | (array[pos+1] << 8 ) | \ | 39 | (array[pos] | (array[pos+1] << 8 ) | \ |
39 | (array[pos+2] << 16 ) | (array[pos+3] << 24 )) | 40 | (array[pos+2] << 16 ) | (array[pos+3] << 24 )) |
40 | 41 | ||
41 | struct partinfo part[8]; | 42 | static struct partinfo part[8]; |
42 | 43 | ||
43 | int disk_init(void) | 44 | struct partinfo* disk_init(void) |
44 | { | 45 | { |
45 | int i; | 46 | int i; |
46 | unsigned char sector[512]; | 47 | unsigned char sector[512]; |
@@ -51,7 +52,7 @@ int disk_init(void) | |||
51 | if ( (sector[510] != 0x55) || | 52 | if ( (sector[510] != 0x55) || |
52 | (sector[511] != 0xaa)) { | 53 | (sector[511] != 0xaa)) { |
53 | DEBUGF("Bad boot sector signature\n"); | 54 | DEBUGF("Bad boot sector signature\n"); |
54 | return -1; | 55 | return NULL; |
55 | } | 56 | } |
56 | 57 | ||
57 | /* parse partitions */ | 58 | /* parse partitions */ |
@@ -70,5 +71,5 @@ int disk_init(void) | |||
70 | } | 71 | } |
71 | } | 72 | } |
72 | 73 | ||
73 | return 0; | 74 | return part; |
74 | } | 75 | } |
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 { | |||
25 | unsigned char type; | 25 | unsigned char type; |
26 | }; | 26 | }; |
27 | 27 | ||
28 | extern struct partinfo part[8]; | 28 | /* returns a pointer to an array of 8 partinfo structs */ |
29 | 29 | struct partinfo* disk_init(void); | |
30 | int disk_init(void); | ||
31 | 30 | ||
32 | #endif | 31 | #endif |