summaryrefslogtreecommitdiff
path: root/target/linux/mediatek/patches-4.4/0201-block2mtd.patch
diff options
context:
space:
mode:
authorJohn Crispin <john@phrozen.org>2016-05-23 11:20:20 +0200
committerJohn Crispin <john@phrozen.org>2016-05-23 11:20:20 +0200
commitf5f173e2b794bd996fa6171bb6b18f13c4ed1e90 (patch)
tree749ba954d2b50e43e9cc83777a0b61dc42734a52 /target/linux/mediatek/patches-4.4/0201-block2mtd.patch
parenta39ac242cc3ec0c2d39342754d86ec97e9e4fb32 (diff)
downloadmtk-20170518-f5f173e2b794bd996fa6171bb6b18f13c4ed1e90.zip
mtk-20170518-f5f173e2b794bd996fa6171bb6b18f13c4ed1e90.tar.gz
mtk-20170518-f5f173e2b794bd996fa6171bb6b18f13c4ed1e90.tar.bz2
mediatek: update patches
* fixes NAND * adds latest ethernet patches Signed-off-by: John Crispin <john@phrozen.org>
Diffstat (limited to 'target/linux/mediatek/patches-4.4/0201-block2mtd.patch')
-rw-r--r--target/linux/mediatek/patches-4.4/0201-block2mtd.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/target/linux/mediatek/patches-4.4/0201-block2mtd.patch b/target/linux/mediatek/patches-4.4/0201-block2mtd.patch
new file mode 100644
index 0000000..395884b
--- /dev/null
+++ b/target/linux/mediatek/patches-4.4/0201-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 @@ static struct block2mtd_dev *add_device(
+ #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 @@ static struct block2mtd_dev *add_device(
+ 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;
+ }