mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: axboe@fb.com
Cc: linux-block@vger.kernel.org,
	Ross Zwisler <ross.zwisler@linux.intel.com>,
	hch@lst.de, linux-kernel@vger.kernel.org
Subject: [PATCH v2 3/3] block: remove ->driverfs_dev
Date: Fri, 11 Mar 2016 07:47:45 -0800	[thread overview]
Message-ID: <20160311154745.24401.877.stgit@dwillia2-desk3.jf.intel.com> (raw)
In-Reply-To: <20160311154727.24401.87967.stgit@dwillia2-desk3.jf.intel.com>

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: Christoph Hellwig <hch@lst.de>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 block/genhd.c         |    5 ++---
 drivers/nvdimm/bus.c  |    2 +-
 include/linux/genhd.h |    4 +---
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/block/genhd.c b/block/genhd.c
index 793672972e1d..e5f73cf99ff8 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -800,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
diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c
index fc82743aefb6..68f56e33ab0c 100644
--- a/drivers/nvdimm/bus.c
+++ b/drivers/nvdimm/bus.c
@@ -307,7 +307,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";
 
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index e736b8587c8a..2e80f4a1ffcd 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -204,7 +204,6 @@ struct gendisk {
 	void *private_data;
 
 	int flags;
-	struct device *driverfs_dev;  // FIXME: remove
 	struct kobject *slave_dir;
 
 	struct timer_rand_state *random;
@@ -434,8 +433,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);

  parent reply	other threads:[~2016-03-11 15:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-11 15:47 [PATCH v2 0/3] Introduce device_add_disk() to kill gendisk.driverfs_dev Dan Williams
2016-03-11 15:47 ` [PATCH v2 1/3] block: introduce device_add_disk() Dan Williams
2016-03-14  8:14   ` Johannes Thumshirn
2016-03-11 15:47 ` [PATCH v2 2/3] block: convert to device_add_disk() Dan Williams
2016-03-14  8:15   ` Johannes Thumshirn
2016-03-11 15:47 ` Dan Williams [this message]
2016-03-14  8:15   ` [PATCH v2 3/3] block: remove ->driverfs_dev Johannes Thumshirn
2016-03-11 16:35 ` [PATCH v2 0/3] Introduce device_add_disk() to kill gendisk.driverfs_dev Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160311154745.24401.877.stgit@dwillia2-desk3.jf.intel.com \
    --to=dan.j.williams@intel.com \
    --cc=axboe@fb.com \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ross.zwisler@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®