aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/ide-disk.c14
-rw-r--r--drivers/scsi/sd.c9
2 files changed, 7 insertions, 16 deletions
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index a072df5053ae..29c8ae752683 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -41,16 +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#define IDE_DISK_PARTS (1 << PARTN_BITS)
45
46#if !defined(CONFIG_DEBUG_BLOCK_EXT_DEVT) 44#if !defined(CONFIG_DEBUG_BLOCK_EXT_DEVT)
47#define IDE_DISK_MINORS IDE_DISK_PARTS 45#define IDE_DISK_MINORS (1 << PARTN_BITS)
48#else 46#else
49#define IDE_DISK_MINORS 1 47#define IDE_DISK_MINORS 1
50#endif 48#endif
51 49
52#define IDE_DISK_EXT_MINORS (IDE_DISK_PARTS - IDE_DISK_MINORS)
53
54struct ide_disk_obj { 50struct ide_disk_obj {
55 ide_drive_t *drive; 51 ide_drive_t *drive;
56 ide_driver_t *driver; 52 ide_driver_t *driver;
@@ -1161,8 +1157,7 @@ static int ide_disk_probe(ide_drive_t *drive)
1161 if (!idkp) 1157 if (!idkp)
1162 goto failed; 1158 goto failed;
1163 1159
1164 g = alloc_disk_ext_node(IDE_DISK_MINORS, IDE_DISK_EXT_MINORS, 1160 g = alloc_disk_node(IDE_DISK_MINORS, hwif_to_node(drive->hwif));
1165 hwif_to_node(drive->hwif));
1166 if (!g) 1161 if (!g)
1167 goto out_free_idkp; 1162 goto out_free_idkp;
1168 1163
@@ -1189,9 +1184,10 @@ static int ide_disk_probe(ide_drive_t *drive)
1189 drive->attach = 1; 1184 drive->attach = 1;
1190 1185
1191 g->minors = IDE_DISK_MINORS; 1186 g->minors = IDE_DISK_MINORS;
1192 g->ext_minors = IDE_DISK_EXT_MINORS;
1193 g->driverfs_dev = &drive->gendev; 1187 g->driverfs_dev = &drive->gendev;
1194 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;
1195 set_capacity(g, idedisk_capacity(drive)); 1191 set_capacity(g, idedisk_capacity(drive));
1196 g->fops = &idedisk_ops; 1192 g->fops = &idedisk_ops;
1197 add_disk(g); 1193 add_disk(g);
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 280d231a86ed..6598024531dd 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -86,16 +86,12 @@ MODULE_ALIAS_SCSI_DEVICE(TYPE_DISK);
86MODULE_ALIAS_SCSI_DEVICE(TYPE_MOD); 86MODULE_ALIAS_SCSI_DEVICE(TYPE_MOD);
87MODULE_ALIAS_SCSI_DEVICE(TYPE_RBC); 87MODULE_ALIAS_SCSI_DEVICE(TYPE_RBC);
88 88
89#define SD_PARTS 64
90
91#if !defined(CONFIG_DEBUG_BLOCK_EXT_DEVT) 89#if !defined(CONFIG_DEBUG_BLOCK_EXT_DEVT)
92#define SD_MINORS 16 90#define SD_MINORS 16
93#else 91#else
94#define SD_MINORS 1 92#define SD_MINORS 1
95#endif 93#endif
96 94
97#define SD_EXT_MINORS (SD_PARTS - SD_MINORS)
98
99static int sd_revalidate_disk(struct gendisk *); 95static int sd_revalidate_disk(struct gendisk *);
100static int sd_probe(struct device *); 96static int sd_probe(struct device *);
101static int sd_remove(struct device *); 97static int sd_remove(struct device *);
@@ -1811,7 +1807,7 @@ static int sd_probe(struct device *dev)
1811 if (!sdkp) 1807 if (!sdkp)
1812 goto out; 1808 goto out;
1813 1809
1814 gd = alloc_disk_ext(SD_MINORS, SD_EXT_MINORS); 1810 gd = alloc_disk(SD_MINORS);
1815 if (!gd) 1811 if (!gd)
1816 goto out_free; 1812 goto out_free;
1817 1813
@@ -1856,7 +1852,6 @@ static int sd_probe(struct device *dev)
1856 gd->major = sd_major((index & 0xf0) >> 4); 1852 gd->major = sd_major((index & 0xf0) >> 4);
1857 gd->first_minor = ((index & 0xf) << 4) | (index & 0xfff00); 1853 gd->first_minor = ((index & 0xf) << 4) | (index & 0xfff00);
1858 gd->minors = SD_MINORS; 1854 gd->minors = SD_MINORS;
1859 gd->ext_minors = SD_EXT_MINORS;
1860 gd->fops = &sd_fops; 1855 gd->fops = &sd_fops;
1861 1856
1862 if (index < 26) { 1857 if (index < 26) {
@@ -1880,7 +1875,7 @@ static int sd_probe(struct device *dev)
1880 blk_queue_prep_rq(sdp->request_queue, sd_prep_fn); 1875 blk_queue_prep_rq(sdp->request_queue, sd_prep_fn);
1881 1876
1882 gd->driverfs_dev = &sdp->sdev_gendev; 1877 gd->driverfs_dev = &sdp->sdev_gendev;
1883 gd->flags = GENHD_FL_DRIVERFS; 1878 gd->flags = GENHD_FL_EXT_DEVT | GENHD_FL_DRIVERFS;
1884 if (sdp->removable) 1879 if (sdp->removable)
1885 gd->flags |= GENHD_FL_REMOVABLE; 1880 gd->flags |= GENHD_FL_REMOVABLE;
1886 1881