X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/8540d5d19ebac6a3f30d82f36ff33f19d728f10b..63151d3b34738ab38919029a9b89927a8982b0f6:/target/linux/generic-2.6/patches-2.6.26/060-block2mtd_init.patch diff --git a/target/linux/generic-2.6/patches-2.6.26/060-block2mtd_init.patch b/target/linux/generic-2.6/patches-2.6.26/060-block2mtd_init.patch index a271efbcd..4f046b469 100644 --- a/target/linux/generic-2.6/patches-2.6.26/060-block2mtd_init.patch +++ b/target/linux/generic-2.6/patches-2.6.26/060-block2mtd_init.patch @@ -8,7 +8,7 @@ #include #include #include -@@ -237,10 +238,11 @@ +@@ -237,10 +238,11 @@ static void block2mtd_free_device(struct /* FIXME: ensure that mtd->size % erase_size == 0 */ @@ -21,7 +21,7 @@ if (!devname) return NULL; -@@ -279,14 +281,18 @@ +@@ -279,14 +281,18 @@ static struct block2mtd_dev *add_device( /* Setup the MTD structure */ /* make the name contain the block device in */ @@ -35,23 +35,20 @@ + if (!dev->mtd.name) goto devinit_err; -+ -+ strcpy(dev->mtd.name, mtdname); - sprintf(dev->mtd.name, "block2mtd: %s", devname); -- ++ strcpy(dev->mtd.name, mtdname); + - dev->mtd.size = dev->blkdev->bd_inode->i_size & PAGE_MASK; + dev->mtd.size = dev->blkdev->bd_inode->i_size & PAGE_MASK & ~(erase_size - 1); dev->mtd.erasesize = erase_size; dev->mtd.writesize = 1; dev->mtd.type = MTD_RAM; -@@ -298,15 +304,18 @@ - dev->mtd.read = block2mtd_read; +@@ -299,14 +305,17 @@ static struct block2mtd_dev *add_device( dev->mtd.priv = dev; dev->mtd.owner = THIS_MODULE; -- + - if (add_mtd_device(&dev->mtd)) { -+ + part = kzalloc(sizeof(struct mtd_partition), GFP_KERNEL); + part->name = dev->mtd.name; + part->offset = 0; @@ -68,7 +65,7 @@ return dev; devinit_err: -@@ -379,9 +388,9 @@ +@@ -379,9 +388,9 @@ static char block2mtd_paramline[80 + 12] static int block2mtd_setup2(const char *val) { @@ -80,7 +77,7 @@ char *name; size_t erase_size = PAGE_SIZE; int i, ret; -@@ -392,7 +401,7 @@ +@@ -392,7 +401,7 @@ static int block2mtd_setup2(const char * strcpy(str, val); kill_final_newline(str); @@ -89,7 +86,7 @@ token[i] = strsep(&str, ","); if (str) -@@ -411,8 +420,10 @@ +@@ -411,8 +420,10 @@ static int block2mtd_setup2(const char * parse_err("illegal erase size"); } } @@ -101,7 +98,7 @@ return 0; } -@@ -446,7 +457,7 @@ +@@ -446,7 +457,7 @@ static int block2mtd_setup(const char *v module_param_call(block2mtd, block2mtd_setup, NULL, NULL, 0200);