block: remove ->driverfs_dev
authorDan Williams <dan.j.williams@intel.com>
Thu, 16 Jun 2016 02:43:07 +0000 (19:43 -0700)
committerDan Williams <dan.j.williams@intel.com>
Mon, 27 Jun 2016 19:26:08 +0000 (12:26 -0700)
Now that all drivers that specify a ->driverfs_dev have been converted
to device_add_disk(), the pointer can be removed from struct gendisk.

Cc: Jens Axboe <axboe@fb.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
block/genhd.c
drivers/nvdimm/bus.c
include/linux/genhd.h

index fb2d9aeb75a5214f313b9d9ccecfc9b1c8080bb2..a18d35390f1d51afb298f90ba3db4dedbec76e9c 100644 (file)
@@ -618,10 +618,6 @@ void device_add_disk(struct device *parent, struct gendisk *disk)
 
        blk_register_region(disk_devt(disk), disk->minors, NULL,
                            exact_match, exact_lock, disk);
-
-       /* temporary while we convert usages to use disk_to_dev(disk)->parent */
-       disk->driverfs_dev = parent;
-
        register_disk(parent, disk);
        blk_register_queue(disk);
 
@@ -804,10 +800,9 @@ void __init printk_all_partitions(void)
                               , disk_name(disk, part->partno, name_buf),
                               part->info ? part->info->uuid : "");
                        if (is_part0) {
-                               if (disk->driverfs_dev != NULL &&
-                                   disk->driverfs_dev->driver != NULL)
+                               if (dev->parent && dev->parent->driver)
                                        printk(" driver: %s\n",
-                                             disk->driverfs_dev->driver->name);
+                                             dev->parent->driver->name);
                                else
                                        printk(" (driver?)\n");
                        } else
index f085f8bceae8e6905b89332bceccbc5066aa9b54..5e4e5c772ea54ff9f5696a1f7d2816d0ebff4d5c 100644 (file)
@@ -312,7 +312,7 @@ EXPORT_SYMBOL(__nd_driver_register);
 
 int nvdimm_revalidate_disk(struct gendisk *disk)
 {
-       struct device *dev = disk->driverfs_dev;
+       struct device *dev = disk_to_dev(disk)->parent;
        struct nd_region *nd_region = to_nd_region(dev->parent);
        const char *pol = nd_region->ro ? "only" : "write";
 
index df1dabbfd3884d4afb3f6ddbd41bac2158b17ed7..1dbf52f9c24b88a0f4a299bae5ec3bfdcea1e566 100644 (file)
@@ -205,7 +205,6 @@ struct gendisk {
        void *private_data;
 
        int flags;
-       struct device *driverfs_dev;  // FIXME: remove
        struct kobject *slave_dir;
 
        struct timer_rand_state *random;
@@ -417,8 +416,7 @@ extern void part_round_stats(int cpu, struct hd_struct *part);
 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);
+       device_add_disk(NULL, disk);
 }
 
 extern void del_gendisk(struct gendisk *gp);