fix a compile error in block2mtd when compiled as module
authorFelix Fietkau <nbd@openwrt.org>
Thu, 18 Feb 2010 21:34:49 +0000 (21:34 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 18 Feb 2010 21:34:49 +0000 (21:34 +0000)
SVN-Revision: 19709

target/linux/generic-2.6/patches-2.6.30/065-rootfs_split.patch
target/linux/generic-2.6/patches-2.6.31/065-rootfs_split.patch
target/linux/generic-2.6/patches-2.6.32/065-rootfs_split.patch

index 824e3df10e057872c86637d945dc9ed53ef0a7b1..34c1f5addface52b3c6b743c2d0514e2aa06c39e 100644 (file)
                if (devt) {
                        bdev = open_by_devnum(devt, FMODE_WRITE | FMODE_READ);
                }
-@@ -263,17 +276,97 @@ static struct block2mtd_dev *add_device(
+@@ -263,17 +276,98 @@ static struct block2mtd_dev *add_device(
  #endif
  
        if (IS_ERR(bdev)) {
 +      bdev = open_by_devnum(devt, FMODE_WRITE | FMODE_READ);
 +      if (!bdev || !bdev->bd_disk)
 +              err = -EINVAL;
-+      else {
++#ifndef CONFIG_MTD_BLOCK2MTD_MODULE
++      else
 +              err = rescan_partitions(bdev->bd_disk, bdev);
-+      }
++#endif
 +      if (bdev)
 +              close_bdev_exclusive(bdev, FMODE_READ|FMODE_WRITE);
 +
  
        if (!mtdname)
                mtdname = devname;
-@@ -297,6 +390,7 @@ static struct block2mtd_dev *add_device(
+@@ -297,6 +391,7 @@ static struct block2mtd_dev *add_device(
        dev->mtd.read = block2mtd_read;
        dev->mtd.priv = dev;
        dev->mtd.owner = THIS_MODULE;
index 50ca25ce6726dbec83656b6e4394a3bb0016be2b..7956baf9b3970f08bbbbac8b6c848078b21b79bc 100644 (file)
                if (devt) {
                        bdev = open_by_devnum(devt, FMODE_WRITE | FMODE_READ);
                }
-@@ -263,17 +276,97 @@ static struct block2mtd_dev *add_device(
+@@ -263,17 +276,98 @@ static struct block2mtd_dev *add_device(
  #endif
  
        if (IS_ERR(bdev)) {
 +      bdev = open_by_devnum(devt, FMODE_WRITE | FMODE_READ);
 +      if (!bdev || !bdev->bd_disk)
 +              err = -EINVAL;
-+      else {
++#ifndef CONFIG_MTD_BLOCK2MTD_MODULE
++      else
 +              err = rescan_partitions(bdev->bd_disk, bdev);
-+      }
++#endif
 +      if (bdev)
 +              close_bdev_exclusive(bdev, FMODE_READ|FMODE_WRITE);
 +
  
        if (!mtdname)
                mtdname = devname;
-@@ -297,6 +390,7 @@ static struct block2mtd_dev *add_device(
+@@ -297,6 +391,7 @@ static struct block2mtd_dev *add_device(
        dev->mtd.read = block2mtd_read;
        dev->mtd.priv = dev;
        dev->mtd.owner = THIS_MODULE;
index 307e5ee347f322f17ef12311f2bdfb6305e4f138..22b3f5e9000ce7113126535756d88a68d218ffbe 100644 (file)
                if (devt) {
                        bdev = open_by_devnum(devt, FMODE_WRITE | FMODE_READ);
                }
-@@ -263,17 +276,97 @@ static struct block2mtd_dev *add_device(
+@@ -263,17 +276,98 @@ static struct block2mtd_dev *add_device(
  #endif
  
        if (IS_ERR(bdev)) {
 +      bdev = open_by_devnum(devt, FMODE_WRITE | FMODE_READ);
 +      if (!bdev || !bdev->bd_disk)
 +              err = -EINVAL;
-+      else {
++#ifndef CONFIG_MTD_BLOCK2MTD_MODULE
++      else
 +              err = rescan_partitions(bdev->bd_disk, bdev);
-+      }
++#endif
 +      if (bdev)
 +              close_bdev_exclusive(bdev, FMODE_READ|FMODE_WRITE);
 +
  
        if (!mtdname)
                mtdname = devname;
-@@ -297,6 +390,7 @@ static struct block2mtd_dev *add_device(
+@@ -297,6 +391,7 @@ static struct block2mtd_dev *add_device(
        dev->mtd.read = block2mtd_read;
        dev->mtd.priv = dev;
        dev->mtd.owner = THIS_MODULE;