[v5,2/5] mmc: move 'parent' tracking to mmc_blk_data
diff mbox

Message ID 146705580308.39775.10937037092465199137.stgit@dwillia2-desk3.amr.corp.intel.com
State New
Headers show

Commit Message

Dan Williams June 27, 2016, 7:30 p.m. UTC
In preparation for the removal of 'driverfs_dev' from 'struct gendisk',
carry this data in mmc_blk_data. It is used for registration of parent
disks and partitions.

Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 drivers/mmc/card/block.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-block" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Bart Van Assche June 28, 2016, 7:26 a.m. UTC | #1
On 06/27/2016 09:30 PM, Dan Williams wrote:
> In preparation for the removal of 'driverfs_dev' from 'struct gendisk',
> carry this data in mmc_blk_data. It is used for registration of parent
> disks and partitions.

Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-block" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christoph Hellwig June 28, 2016, 11:57 a.m. UTC | #2
Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>
--
To unsubscribe from this list: send the line "unsubscribe linux-block" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ulf Hansson July 12, 2016, 1:51 p.m. UTC | #3
On 27 June 2016 at 21:30, Dan Williams <dan.j.williams@intel.com> wrote:
> In preparation for the removal of 'driverfs_dev' from 'struct gendisk',
> carry this data in mmc_blk_data. It is used for registration of parent
> disks and partitions.
>
> Cc: Ulf Hansson <ulf.hansson@linaro.org>
> Cc: Bart Van Assche <bart.vanassche@sandisk.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>

If not too late (sorry for the delay):

Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe

> ---
>  drivers/mmc/card/block.c |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
> index 383184743f9a..d1733424bf6e 100644
> --- a/drivers/mmc/card/block.c
> +++ b/drivers/mmc/card/block.c
> @@ -93,6 +93,7 @@ static DEFINE_SPINLOCK(mmc_blk_lock);
>   */
>  struct mmc_blk_data {
>         spinlock_t      lock;
> +       struct device   *parent;
>         struct gendisk  *disk;
>         struct mmc_queue queue;
>         struct list_head part;
> @@ -2270,7 +2271,7 @@ again:
>         md->disk->fops = &mmc_bdops;
>         md->disk->private_data = md;
>         md->disk->queue = md->queue.queue;
> -       md->disk->driverfs_dev = parent;
> +       md->parent = parent;
>         set_disk_ro(md->disk, md->read_only || default_ro);
>         md->disk->flags = GENHD_FL_EXT_DEVT;
>         if (area_type & (MMC_BLK_DATA_AREA_RPMB | MMC_BLK_DATA_AREA_BOOT))
> @@ -2458,7 +2459,7 @@ static int mmc_add_disk(struct mmc_blk_data *md)
>         int ret;
>         struct mmc_card *card = md->queue.card;
>
> -       add_disk(md->disk);
> +       device_add_disk(md->parent, md->disk);
>         md->force_ro.show = force_ro_show;
>         md->force_ro.store = force_ro_store;
>         sysfs_attr_init(&md->force_ro.attr);
>
--
To unsubscribe from this list: send the line "unsubscribe linux-block" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 383184743f9a..d1733424bf6e 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -93,6 +93,7 @@  static DEFINE_SPINLOCK(mmc_blk_lock);
  */
 struct mmc_blk_data {
 	spinlock_t	lock;
+	struct device	*parent;
 	struct gendisk	*disk;
 	struct mmc_queue queue;
 	struct list_head part;
@@ -2270,7 +2271,7 @@  again:
 	md->disk->fops = &mmc_bdops;
 	md->disk->private_data = md;
 	md->disk->queue = md->queue.queue;
-	md->disk->driverfs_dev = parent;
+	md->parent = parent;
 	set_disk_ro(md->disk, md->read_only || default_ro);
 	md->disk->flags = GENHD_FL_EXT_DEVT;
 	if (area_type & (MMC_BLK_DATA_AREA_RPMB | MMC_BLK_DATA_AREA_BOOT))
@@ -2458,7 +2459,7 @@  static int mmc_add_disk(struct mmc_blk_data *md)
 	int ret;
 	struct mmc_card *card = md->queue.card;
 
-	add_disk(md->disk);
+	device_add_disk(md->parent, md->disk);
 	md->force_ro.show = force_ro_show;
 	md->force_ro.store = force_ro_store;
 	sysfs_attr_init(&md->force_ro.attr);