summaryrefslogtreecommitdiff
path: root/include/linux/genhd.h
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2016-06-15 18:17:27 -0700
committerDan Williams <dan.j.williams@intel.com>2016-06-15 19:53:06 -0700
commite63a46bef01ff3064f44dba145833284fb6adeec (patch)
tree01890349347ab2a8bf4ac1bb42004647d88ea4bf /include/linux/genhd.h
parent1b57e66384e2d21150301e68078526fac5680a16 (diff)
block: introduce device_add_disk()
In preparation for removing the ->driverfs_dev member of a gendisk, add an api that takes the parent device as a parameter to add_disk(). For now this maintains the status quo of WARN()ing on failure, but not return a error code. Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'include/linux/genhd.h')
-rw-r--r--include/linux/genhd.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 359a8e4bd44d..df1dabbfd388 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -414,7 +414,13 @@ static inline void free_part_info(struct hd_struct *part)
extern void part_round_stats(int cpu, struct hd_struct *part);
/* block/genhd.c */
-extern void add_disk(struct gendisk *disk);
+extern void device_add_disk(struct device *parent, struct gendisk *disk);
+static inline void add_disk(struct gendisk *disk)
+{
+ /* temporary while we convert callers to device_add_disk */
+ device_add_disk(disk->driverfs_dev, disk);
+}
+
extern void del_gendisk(struct gendisk *gp);
extern struct gendisk *get_gendisk(dev_t dev, int *partno);
extern struct block_device *bdget_disk(struct gendisk *disk, int partno);