Fix broken patch to drivers/mtd/device/block2mtd.c
authorLars-Peter Clausen <lars@metafoo.de>
Wed, 5 Nov 2008 10:47:35 +0000 (10:47 +0000)
committerLars-Peter Clausen <lars@metafoo.de>
Wed, 5 Nov 2008 10:47:35 +0000 (10:47 +0000)
SVN-Revision: 13125

target/linux/generic-2.6/patches-2.6.27/065-rootfs_split.patch

index 41cca49cc31fb30c0dd3a8b490bb49b198115728..aff95cceccfd563c1ce28fb13ece246ba1011a0f 100644 (file)
        return;
  }
  
-@@ -231,31 +272,22 @@ static void block2mtd_free_device(struct
-       kfree(dev);
+@@ -288,47 +288,17 @@ static void block2mtd_sync(struct mtd_info *mtd)
  }
  
+-static void block2mtd_free_device(struct block2mtd_dev *dev)
+-{
+-      if (!dev)
+-              return;
+-
+-      kfree(dev->mtd.name);
+-
+-      if (dev->blkdev) {
+-              invalidate_mapping_pages(dev->blkdev->bd_inode->i_mapping,
+-                                      0, -1);
+-              close_bdev_excl(dev->blkdev);
+-      }
+-
+-      kfree(dev);
+-}
+-
 -
 -/* FIXME: ensure that mtd->size % erase_size == 0 */
 -static struct block2mtd_dev *add_device(char *devname, int erase_size, const char *mtdname)
 +static int _open_bdev(struct block2mtd_dev *dev)
  {
        struct block_device *bdev;
-       struct block2mtd_dev *dev;
-       struct mtd_partition *part;
-       char *name;
+-      struct block2mtd_dev *dev;
+-      struct mtd_partition *part;
+-      char *name;
  
 -      if (!devname)
 -              return NULL;
                if (devt) {
                        bdev = open_by_devnum(devt, FMODE_WRITE | FMODE_READ);
                }
-@@ -263,17 +295,96 @@ static struct block2mtd_dev *add_device(
+@@ -263,17 +295,97 @@ static struct block2mtd_dev *add_device(
  #endif
  
        if (IS_ERR(bdev)) {
 +{
 +      struct block2mtd_dev *dev;
 +      struct mtd_partition *part;
++      char *name;
 +
 +      if (!devname)
 +              return NULL;