aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2016-07-08 18:04:11 -0400
committerJens Axboe <axboe@fb.com>2016-07-08 18:04:11 -0400
commit41d512e51b5e59ee2598f74249799dcc6b0a06f2 (patch)
tree643954473c2893accfd6f45e7ea9e608023c1c51 /block
parent7110230719602852481c2793d054f866b2bf4a2b (diff)
parent52c44d93c26f5a76068c0a8cc83bb8f56f38043d (diff)
Merge branch 'for-4.8/block' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm into for-4.8/drivers
Dan writes: "The removal of ->driverfs_dev in favor of just passing the parent device in as a parameter to add_disk(). See below, it has received a "Reviewed-by" from Christoph, Bart, and Johannes. It is also a pre-requisite for Fam Zheng's work to cleanup gendisk uevents vs attribute visibility [1]. We would extend device_add_disk() to take an attribute_group list. This is based off a branch of block.git/for-4.8/drivers and has received a positive build success notification from the kbuild robot across several configs. [1]: "gendisk: Generate uevent after attribute available" http://marc.info/?l=linux-virtualization&m=146725201522201&w=2"
Diffstat (limited to 'block')
-rw-r--r--block/genhd.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/block/genhd.c b/block/genhd.c
index 9f42526b4d62..a18d35390f1d 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -506,7 +506,7 @@ static int exact_lock(dev_t devt, void *data)
506 return 0; 506 return 0;
507} 507}
508 508
509static void register_disk(struct gendisk *disk) 509static void register_disk(struct device *parent, struct gendisk *disk)
510{ 510{
511 struct device *ddev = disk_to_dev(disk); 511 struct device *ddev = disk_to_dev(disk);
512 struct block_device *bdev; 512 struct block_device *bdev;
@@ -514,7 +514,7 @@ static void register_disk(struct gendisk *disk)
514 struct hd_struct *part; 514 struct hd_struct *part;
515 int err; 515 int err;
516 516
517 ddev->parent = disk->driverfs_dev; 517 ddev->parent = parent;
518 518
519 dev_set_name(ddev, "%s", disk->disk_name); 519 dev_set_name(ddev, "%s", disk->disk_name);
520 520
@@ -573,7 +573,8 @@ exit:
573} 573}
574 574
575/** 575/**
576 * add_disk - add partitioning information to kernel list 576 * device_add_disk - add partitioning information to kernel list
577 * @parent: parent device for the disk
577 * @disk: per-device partitioning information 578 * @disk: per-device partitioning information
578 * 579 *
579 * This function registers the partitioning information in @disk 580 * This function registers the partitioning information in @disk
@@ -581,7 +582,7 @@ exit:
581 * 582 *
582 * FIXME: error handling 583 * FIXME: error handling
583 */ 584 */
584void add_disk(struct gendisk *disk) 585void device_add_disk(struct device *parent, struct gendisk *disk)
585{ 586{
586 struct backing_dev_info *bdi; 587 struct backing_dev_info *bdi;
587 dev_t devt; 588 dev_t devt;
@@ -617,7 +618,7 @@ void add_disk(struct gendisk *disk)
617 618
618 blk_register_region(disk_devt(disk), disk->minors, NULL, 619 blk_register_region(disk_devt(disk), disk->minors, NULL,
619 exact_match, exact_lock, disk); 620 exact_match, exact_lock, disk);
620 register_disk(disk); 621 register_disk(parent, disk);
621 blk_register_queue(disk); 622 blk_register_queue(disk);
622 623
623 /* 624 /*
@@ -633,7 +634,7 @@ void add_disk(struct gendisk *disk)
633 disk_add_events(disk); 634 disk_add_events(disk);
634 blk_integrity_add(disk); 635 blk_integrity_add(disk);
635} 636}
636EXPORT_SYMBOL(add_disk); 637EXPORT_SYMBOL(device_add_disk);
637 638
638void del_gendisk(struct gendisk *disk) 639void del_gendisk(struct gendisk *disk)
639{ 640{
@@ -799,10 +800,9 @@ void __init printk_all_partitions(void)
799 , disk_name(disk, part->partno, name_buf), 800 , disk_name(disk, part->partno, name_buf),
800 part->info ? part->info->uuid : ""); 801 part->info ? part->info->uuid : "");
801 if (is_part0) { 802 if (is_part0) {
802 if (disk->driverfs_dev != NULL && 803 if (dev->parent && dev->parent->driver)
803 disk->driverfs_dev->driver != NULL)
804 printk(" driver: %s\n", 804 printk(" driver: %s\n",
805 disk->driverfs_dev->driver->name); 805 dev->parent->driver->name);
806 else 806 else
807 printk(" (driver?)\n"); 807 printk(" (driver?)\n");
808 } else 808 } else