]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/md/dm-table.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/viro/bdev
[linux-2.6-omap-h63xx.git] / drivers / md / dm-table.c
index dd8bd2e867cdd7c09783ccf0e1653a6a9808d43c..a63161aec48750ef51feb6e6e506c7ff83044dc0 100644 (file)
@@ -312,19 +312,6 @@ static inline int check_space(struct dm_table *t)
        return 0;
 }
 
-/*
- * Convert a device path to a dev_t.
- */
-static int lookup_device(const char *path, dev_t *dev)
-{
-       struct block_device *bdev = lookup_bdev(path);
-       if (IS_ERR(bdev))
-               return PTR_ERR(bdev);
-       *dev = bdev->bd_dev;
-       bdput(bdev);
-       return 0;
-}
-
 /*
  * See if we've already got a device in the list.
  */
@@ -437,8 +424,12 @@ static int __table_get_device(struct dm_table *t, struct dm_target *ti,
                        return -EOVERFLOW;
        } else {
                /* convert the path to a device */
-               if ((r = lookup_device(path, &dev)))
-                       return r;
+               struct block_device *bdev = lookup_bdev(path);
+
+               if (IS_ERR(bdev))
+                       return PTR_ERR(bdev);
+               dev = bdev->bd_dev;
+               bdput(bdev);
        }
 
        dd = find_device(&t->devices, dev);