diff options
author | John Crispin <blogic@openwrt.org> | 2016-03-23 11:12:34 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2016-03-23 11:12:34 +0000 |
commit | 6c570f3b31bad47ed519d5067eaeae3226117e1e (patch) | |
tree | 4f21fd140c3afbac1c0c4005bb6cdd36d892af36 /target/linux/mediatek/patches-4.4 | |
parent | c7e9bc5376184af86f55987756e45600dcaf78d8 (diff) | |
download | master-187ad058-6c570f3b31bad47ed519d5067eaeae3226117e1e.tar.gz master-187ad058-6c570f3b31bad47ed519d5067eaeae3226117e1e.tar.bz2 master-187ad058-6c570f3b31bad47ed519d5067eaeae3226117e1e.zip |
mediatek: patch block2mtd to allow cmdlineparts to work
Signed-off-by: John Crispin <blogic@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@49067 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/mediatek/patches-4.4')
-rw-r--r-- | target/linux/mediatek/patches-4.4/0100-block2mtd.patch | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/target/linux/mediatek/patches-4.4/0100-block2mtd.patch b/target/linux/mediatek/patches-4.4/0100-block2mtd.patch new file mode 100644 index 0000000000..7fbd6d4019 --- /dev/null +++ b/target/linux/mediatek/patches-4.4/0100-block2mtd.patch @@ -0,0 +1,32 @@ +--- a/drivers/mtd/devices/block2mtd.c ++++ b/drivers/mtd/devices/block2mtd.c +@@ -32,6 +32,8 @@ + #include <linux/slab.h> + #include <linux/major.h> + ++static const char * const block2mtd_probe_types[] = { "cmdlinepart", NULL }; ++ + /* Info for the block device */ + struct block2mtd_dev { + struct list_head list; +@@ -227,6 +229,7 @@ + #endif + const fmode_t mode = FMODE_READ | FMODE_WRITE | FMODE_EXCL; + struct block_device *bdev = ERR_PTR(-ENODEV); ++ struct mtd_part_parser_data ppdata = { 0 }; + struct block2mtd_dev *dev; + struct mtd_partition *part; + char *name; +@@ -307,11 +310,7 @@ + dev->mtd.priv = dev; + dev->mtd.owner = THIS_MODULE; + +- part = kzalloc(sizeof(struct mtd_partition), GFP_KERNEL); +- part->name = name; +- part->offset = 0; +- part->size = dev->mtd.size; +- if (mtd_device_register(&dev->mtd, part, 1)) { ++ if (mtd_device_parse_register(&dev->mtd, block2mtd_probe_types, &ppdata, NULL, 0)) { + /* Device didn't get added, so free the entry */ + goto err_destroy_mutex; + } |