diff options
author | Dan Williams <dan.j.williams@intel.com> | 2016-06-20 10:44:32 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2016-06-22 10:19:16 -0700 |
commit | d72a57835c92f6d51863b0ad6d7d45e3859e24d4 (patch) | |
tree | 616e2f91b5f2a938454536a55f688769a847f774 /arch/um | |
parent | 307d8e6f248558b184a2513593dbbeb08406a4fa (diff) | |
download | linux-stable-d72a57835c92f6d51863b0ad6d7d45e3859e24d4.tar.gz linux-stable-d72a57835c92f6d51863b0ad6d7d45e3859e24d4.tar.bz2 linux-stable-d72a57835c92f6d51863b0ad6d7d45e3859e24d4.zip |
um: track 'parent' device in a local variable
In preparation for the removal of 'driverfs_dev' from 'struct gendisk'
use a local variable to track the parented vs un-parented case in
ubd_disk_register().
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'arch/um')
-rw-r--r-- | arch/um/drivers/ubd_kern.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index ef6b4d960bad..f3540270d096 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c @@ -801,6 +801,7 @@ static void ubd_device_release(struct device *dev) static int ubd_disk_register(int major, u64 size, int unit, struct gendisk **disk_out) { + struct device *parent = NULL; struct gendisk *disk; disk = alloc_disk(1 << UBD_SHIFT); @@ -823,12 +824,12 @@ static int ubd_disk_register(int major, u64 size, int unit, ubd_devs[unit].pdev.dev.release = ubd_device_release; dev_set_drvdata(&ubd_devs[unit].pdev.dev, &ubd_devs[unit]); platform_device_register(&ubd_devs[unit].pdev); - disk->driverfs_dev = &ubd_devs[unit].pdev.dev; + parent = &ubd_devs[unit].pdev.dev; } disk->private_data = &ubd_devs[unit]; disk->queue = ubd_devs[unit].queue; - add_disk(disk); + device_add_disk(parent, disk); *disk_out = disk; return 0; |