mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
block: convert to device_add_disk()
For block drivers that specify a parent device, convert them to use
device_add_disk().
This conversion was done with the following semantic patch:
@@
struct gendisk *disk;
expression E;
@@
- disk->driverfs_dev = E;
...
- add_disk(disk);
+ device_add_disk(E, disk);
@@
struct gendisk *disk;
expression E1, E2;
@@
- disk->driverfs_dev = E1;
...
E2 = disk;
...
- add_disk(E2);
+ device_add_disk(E1, E2);
...plus some manual fixups for a few missed conversions.
Cc: Jens Axboe <[email protected]>
Cc: Keith Busch <[email protected]>
Cc: Michael S. Tsirkin <[email protected]>
Cc: David Woodhouse <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: James Bottomley <[email protected]>
Cc: Ross Zwisler <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: Martin K. Petersen <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Signed-off-by: Dan Williams <[email protected]>
This commit is contained in:
parent
d72a57835c
commit
0d52c756a6
25 changed files with 28 additions and 56 deletions
|
|
@ -2146,7 +2146,6 @@ static int msb_init_disk(struct memstick_dev *card)
|
|||
msb->disk->fops = &msb_bdops;
|
||||
msb->disk->private_data = msb;
|
||||
msb->disk->queue = msb->queue;
|
||||
msb->disk->driverfs_dev = &card->dev;
|
||||
msb->disk->flags |= GENHD_FL_EXT_DEVT;
|
||||
|
||||
capacity = msb->pages_in_block * msb->logical_block_count;
|
||||
|
|
@ -2163,7 +2162,7 @@ static int msb_init_disk(struct memstick_dev *card)
|
|||
set_disk_ro(msb->disk, 1);
|
||||
|
||||
msb_start(card);
|
||||
add_disk(msb->disk);
|
||||
device_add_disk(&card->dev, msb->disk);
|
||||
dbg("Disk added");
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -1243,7 +1243,6 @@ static int mspro_block_init_disk(struct memstick_dev *card)
|
|||
msb->usage_count = 1;
|
||||
msb->disk->private_data = msb;
|
||||
msb->disk->queue = msb->queue;
|
||||
msb->disk->driverfs_dev = &card->dev;
|
||||
|
||||
sprintf(msb->disk->disk_name, "mspblk%d", disk_id);
|
||||
|
||||
|
|
@ -1255,7 +1254,7 @@ static int mspro_block_init_disk(struct memstick_dev *card)
|
|||
set_capacity(msb->disk, capacity);
|
||||
dev_dbg(&card->dev, "capacity set %ld\n", capacity);
|
||||
|
||||
add_disk(msb->disk);
|
||||
device_add_disk(&card->dev, msb->disk);
|
||||
msb->active = 1;
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue