[generic]Âbackport upstream commit 0079c5aee34880bcee7feee9960f0502c73dc5fa (xt_recen...
[openwrt.git] / target / linux / generic / patches-2.6.38 / 067-block2mtd_2.6.38_fix.patch
1 --- a/drivers/mtd/devices/block2mtd.c
2 +++ b/drivers/mtd/devices/block2mtd.c
3 @@ -264,12 +264,13 @@ static int _open_bdev(struct block2mtd_d
4 bdev = blkdev_get_by_path(dev->devname, mode, dev);
5 #ifndef MODULE
6 if (IS_ERR(bdev)) {
7 + dev_t devt;
8
9 /* We might not have rootfs mounted at this point. Try
10 to resolve the device name by other means. */
11
12 wait_for_device_probe();
13 - dev_t devt = name_to_dev_t(dev->devname);
14 + devt = name_to_dev_t(dev->devname);
15 if (devt)
16 bdev = blkdev_get_by_dev(devt, mode, dev);
17 }
18 @@ -330,7 +331,7 @@ static int block2mtd_refresh(struct mtd_
19 _close_bdev(dev);
20
21 /* open the whole disk, issue a partition rescan, then */
22 - bdev = blkdev_get_by_dev(devt, FMODE_WRITE | FMODE_READ);
23 + bdev = blkdev_get_by_dev(devt, FMODE_WRITE | FMODE_READ, mtd);
24 if (!bdev || !bdev->bd_disk)
25 err = -EINVAL;
26 #ifndef CONFIG_MTD_BLOCK2MTD_MODULE
27 @@ -395,7 +396,7 @@ static struct block2mtd_dev *add_device(
28 dev->mtd.refresh_device = block2mtd_refresh;
29
30 part = kzalloc(sizeof(struct mtd_partition), GFP_KERNEL);
31 - part->name = dev->mtd.name;
32 + part->name = name;
33 part->offset = 0;
34 part->size = dev->mtd.size;
35 if (add_mtd_partitions(&dev->mtd, part, 1)) {
This page took 0.045321 seconds and 5 git commands to generate.