block: add a bdev_is_partition helper
[linux-2.6-microblaze.git] / block / blk-lib.c
index 0d1811e..e90614f 100644 (file)
@@ -64,7 +64,7 @@ int __blkdev_issue_discard(struct block_device *bdev, sector_t sector,
                return -EINVAL;
 
        /* In case the discard request is in a partition */
-       if (bdev->bd_partno)
+       if (bdev_is_partition(bdev))
                part_offset = bdev->bd_part->start_sect;
 
        while (nr_sects) {