summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/genhd.c2
-rw-r--r--block/partitions/core.c4
2 files changed, 1 insertions, 5 deletions
diff --git a/block/genhd.c b/block/genhd.c
index 8c1816d2929e..9fa734cb9cbd 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -497,7 +497,6 @@ static void __device_add_disk(struct device *parent, struct gendisk *disk,
}
} else {
WARN_ON(disk->minors);
- WARN_ON(!(disk->flags & (GENHD_FL_EXT_DEVT | GENHD_FL_HIDDEN)));
ret = blk_alloc_ext_minor();
if (ret < 0) {
@@ -506,6 +505,7 @@ static void __device_add_disk(struct device *parent, struct gendisk *disk,
}
disk->major = BLOCK_EXT_MAJOR;
disk->first_minor = MINOR(ret);
+ disk->flags |= GENHD_FL_EXT_DEVT;
}
disk->flags |= GENHD_FL_UP;
diff --git a/block/partitions/core.c b/block/partitions/core.c
index 504297bdc8bf..ada3e1e66989 100644
--- a/block/partitions/core.c
+++ b/block/partitions/core.c
@@ -326,10 +326,6 @@ static struct block_device *add_partition(struct gendisk *disk, int partno,
const char *dname;
int err;
- /*
- * disk_max_parts() won't be zero, either GENHD_FL_EXT_DEVT is set
- * or 'minors' is passed to alloc_disk().
- */
if (partno >= disk_max_parts(disk))
return ERR_PTR(-EINVAL);