diff options
| -rw-r--r-- | arch/m68k/emu/nfblock.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/m68k/emu/nfblock.c b/arch/m68k/emu/nfblock.c index 38049357d6d3..40712e49381b 100644 --- a/arch/m68k/emu/nfblock.c +++ b/arch/m68k/emu/nfblock.c | |||
| @@ -155,18 +155,22 @@ out: | |||
| 155 | static int __init nfhd_init(void) | 155 | static int __init nfhd_init(void) |
| 156 | { | 156 | { |
| 157 | u32 blocks, bsize; | 157 | u32 blocks, bsize; |
| 158 | int ret; | ||
| 158 | int i; | 159 | int i; |
| 159 | 160 | ||
| 160 | nfhd_id = nf_get_id("XHDI"); | 161 | nfhd_id = nf_get_id("XHDI"); |
| 161 | if (!nfhd_id) | 162 | if (!nfhd_id) |
| 162 | return -ENODEV; | 163 | return -ENODEV; |
| 163 | 164 | ||
| 164 | major_num = register_blkdev(major_num, "nfhd"); | 165 | ret = register_blkdev(major_num, "nfhd"); |
| 165 | if (major_num <= 0) { | 166 | if (ret < 0) { |
| 166 | pr_warn("nfhd: unable to get major number\n"); | 167 | pr_warn("nfhd: unable to get major number\n"); |
| 167 | return major_num; | 168 | return ret; |
| 168 | } | 169 | } |
| 169 | 170 | ||
| 171 | if (!major_num) | ||
| 172 | major_num = ret; | ||
| 173 | |||
| 170 | for (i = NFHD_DEV_OFFSET; i < 24; i++) { | 174 | for (i = NFHD_DEV_OFFSET; i < 24; i++) { |
| 171 | if (nfhd_get_capacity(i, 0, &blocks, &bsize)) | 175 | if (nfhd_get_capacity(i, 0, &blocks, &bsize)) |
| 172 | continue; | 176 | continue; |
