mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
block: struct device - replace bus_id with dev_name(), dev_set_name()
Cc: Jens Axboe <[email protected]> Signed-off-by: Kay Sievers <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
4383fc3d9a
commit
3ada8b7e98
3 changed files with 7 additions and 12 deletions
|
|
@ -384,9 +384,9 @@ struct hd_struct *add_partition(struct gendisk *disk, int partno,
|
|||
|
||||
dname = dev_name(ddev);
|
||||
if (isdigit(dname[strlen(dname) - 1]))
|
||||
snprintf(pdev->bus_id, BUS_ID_SIZE, "%sp%d", dname, partno);
|
||||
dev_set_name(pdev, "%sp%d", dname, partno);
|
||||
else
|
||||
snprintf(pdev->bus_id, BUS_ID_SIZE, "%s%d", dname, partno);
|
||||
dev_set_name(pdev, "%s%d", dname, partno);
|
||||
|
||||
device_initialize(pdev);
|
||||
pdev->class = &block_class;
|
||||
|
|
@ -447,16 +447,11 @@ void register_disk(struct gendisk *disk)
|
|||
struct block_device *bdev;
|
||||
struct disk_part_iter piter;
|
||||
struct hd_struct *part;
|
||||
char *s;
|
||||
int err;
|
||||
|
||||
ddev->parent = disk->driverfs_dev;
|
||||
|
||||
strlcpy(ddev->bus_id, disk->disk_name, BUS_ID_SIZE);
|
||||
/* ewww... some of these buggers have / in the name... */
|
||||
s = strchr(ddev->bus_id, '/');
|
||||
if (s)
|
||||
*s = '!';
|
||||
dev_set_name(ddev, disk->disk_name);
|
||||
|
||||
/* delay uevents, until we scanned partition table */
|
||||
ddev->uevent_suppress = 1;
|
||||
|
|
|
|||
Loading…
Reference in a new issue