mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
block: always set bdev->bd_part
Till now, bdev->bd_part is set only if the bdev was for parts other than part0. This patch makes bdev->bd_part always set so that code paths don't have to differenciate common handling. Signed-off-by: Tejun Heo <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
4c46501d16
commit
0762b8bde9
5 changed files with 35 additions and 48 deletions
|
|
@ -134,12 +134,7 @@ char *disk_name(struct gendisk *hd, int partno, char *buf)
|
|||
|
||||
const char *bdevname(struct block_device *bdev, char *buf)
|
||||
{
|
||||
int partno = 0;
|
||||
|
||||
if (bdev->bd_part)
|
||||
partno = bdev->bd_part->partno;
|
||||
|
||||
return disk_name(bdev->bd_disk, partno, buf);
|
||||
return disk_name(bdev->bd_disk, bdev->bd_part->partno, buf);
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(bdevname);
|
||||
|
|
|
|||
Loading…
Reference in a new issue