summaryrefslogtreecommitdiff
path: root/block/genhd.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-11-02 21:29:52 +0300
committerJason Liu <jason.hui.liu@nxp.com>2019-02-12 10:33:25 +0800
commitbece506fe73817b65143e2ef0a13451360bbd4ab (patch)
tree6e6ae30076e68f1fdfd0b8d777d8f1cffa2973e8 /block/genhd.c
parentc21c8b24ef14c66c2764134eb6822bbc884048b7 (diff)
block: don't look at the struct device dev_t in disk_devt
The hidden gendisks introduced in the next patch need to keep the dev field in their struct device empty so that udev won't try to create block device nodes for them. To support that rewrite disk_devt to look at the major and first_minor fields in the gendisk itself instead of looking into the struct device. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Jens Axboe <axboe@kernel.dk> (cherry picked from commit 517bf3c306bad4fe0da631f90ae2ec40924dee2b)
Diffstat (limited to 'block/genhd.c')
-rw-r--r--block/genhd.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/block/genhd.c b/block/genhd.c
index 449ef56bba70..69c50d457d3f 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -661,10 +661,6 @@ void device_add_disk(struct device *parent, struct gendisk *disk)
return;
}
disk_to_dev(disk)->devt = devt;
-
- /* ->major and ->first_minor aren't supposed to be
- * dereferenced from here on, but set them just in case.
- */
disk->major = MAJOR(devt);
disk->first_minor = MINOR(devt);