Skip to content

Commit

Permalink
block: remove ->driverfs_dev
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Ross Zwisler <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Signed-off-by: Dan Williams <[email protected]>
  • Loading branch information
djbw committed Jun 27, 2016
1 parent 0d52c75 commit 52c44d9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
9 changes: 2 additions & 7 deletions block/genhd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion drivers/nvdimm/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
4 changes: 1 addition & 3 deletions include/linux/genhd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 52c44d9

Please sign in to comment.