+@@ -264,12 +264,13 @@ static int _open_bdev(struct block2mtd_d
+ bdev = blkdev_get_by_path(dev->devname, mode, dev);
+ #ifndef MODULE
+ if (IS_ERR(bdev)) {
++ dev_t devt;
+
+ /* We might not have rootfs mounted at this point. Try
+ to resolve the device name by other means. */
+
+ wait_for_device_probe();
+- dev_t devt = name_to_dev_t(dev->devname);
++ devt = name_to_dev_t(dev->devname);
+ if (devt)
+ bdev = blkdev_get_by_dev(devt, mode, dev);
+ }
+@@ -330,7 +331,7 @@ static int block2mtd_refresh(struct mtd_