diff options
Diffstat (limited to 'drivers/ide/ide-disk.c')
-rw-r--r-- | drivers/ide/ide-disk.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 07ef88bd109b..33ea8c048717 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c | |||
@@ -41,6 +41,12 @@ | |||
41 | #include <asm/io.h> | 41 | #include <asm/io.h> |
42 | #include <asm/div64.h> | 42 | #include <asm/div64.h> |
43 | 43 | ||
44 | #if !defined(CONFIG_DEBUG_BLOCK_EXT_DEVT) | ||
45 | #define IDE_DISK_MINORS (1 << PARTN_BITS) | ||
46 | #else | ||
47 | #define IDE_DISK_MINORS 0 | ||
48 | #endif | ||
49 | |||
44 | struct ide_disk_obj { | 50 | struct ide_disk_obj { |
45 | ide_drive_t *drive; | 51 | ide_drive_t *drive; |
46 | ide_driver_t *driver; | 52 | ide_driver_t *driver; |
@@ -1151,8 +1157,7 @@ static int ide_disk_probe(ide_drive_t *drive) | |||
1151 | if (!idkp) | 1157 | if (!idkp) |
1152 | goto failed; | 1158 | goto failed; |
1153 | 1159 | ||
1154 | g = alloc_disk_node(1 << PARTN_BITS, | 1160 | g = alloc_disk_node(IDE_DISK_MINORS, hwif_to_node(drive->hwif)); |
1155 | hwif_to_node(drive->hwif)); | ||
1156 | if (!g) | 1161 | if (!g) |
1157 | goto out_free_idkp; | 1162 | goto out_free_idkp; |
1158 | 1163 | ||
@@ -1178,9 +1183,11 @@ static int ide_disk_probe(ide_drive_t *drive) | |||
1178 | } else | 1183 | } else |
1179 | drive->attach = 1; | 1184 | drive->attach = 1; |
1180 | 1185 | ||
1181 | g->minors = 1 << PARTN_BITS; | 1186 | g->minors = IDE_DISK_MINORS; |
1182 | g->driverfs_dev = &drive->gendev; | 1187 | g->driverfs_dev = &drive->gendev; |
1183 | g->flags = drive->removable ? GENHD_FL_REMOVABLE : 0; | 1188 | g->flags |= GENHD_FL_EXT_DEVT; |
1189 | if (drive->removable) | ||
1190 | g->flags |= GENHD_FL_REMOVABLE; | ||
1184 | set_capacity(g, idedisk_capacity(drive)); | 1191 | set_capacity(g, idedisk_capacity(drive)); |
1185 | g->fops = &idedisk_ops; | 1192 | g->fops = &idedisk_ops; |
1186 | add_disk(g); | 1193 | add_disk(g); |