kernel: make the kernel 3.18 patches apply and boot on arm.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> SVN-Revision: 43095
This commit is contained in:
@@ -8,10 +8,10 @@
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/mount.h>
|
||||
#include <linux/slab.h>
|
||||
@@ -210,11 +211,12 @@ static void block2mtd_free_device(struct
|
||||
@@ -209,11 +210,12 @@ static void block2mtd_free_device(struct
|
||||
}
|
||||
|
||||
|
||||
/* FIXME: ensure that mtd->size % erase_size == 0 */
|
||||
-static struct block2mtd_dev *add_device(char *devname, int erase_size)
|
||||
+static struct block2mtd_dev *add_device(char *devname, int erase_size, const char *mtdname)
|
||||
{
|
||||
@@ -22,7 +22,7 @@
|
||||
char *name;
|
||||
|
||||
if (!devname)
|
||||
@@ -253,13 +255,16 @@ static struct block2mtd_dev *add_device(
|
||||
@@ -257,13 +259,16 @@ static struct block2mtd_dev *add_device(
|
||||
|
||||
/* Setup the MTD structure */
|
||||
/* make the name contain the block device in */
|
||||
@@ -31,7 +31,7 @@
|
||||
+ mtdname = devname;
|
||||
+ name = kmalloc(strlen(mtdname) + 1, GFP_KERNEL);
|
||||
if (!name)
|
||||
goto devinit_err;
|
||||
goto err_destroy_mutex;
|
||||
|
||||
+ strcpy(name, mtdname);
|
||||
dev->mtd.name = name;
|
||||
@@ -41,7 +41,7 @@
|
||||
dev->mtd.erasesize = erase_size;
|
||||
dev->mtd.writesize = 1;
|
||||
dev->mtd.writebufsize = PAGE_SIZE;
|
||||
@@ -272,15 +277,18 @@ static struct block2mtd_dev *add_device(
|
||||
@@ -276,15 +281,18 @@ static struct block2mtd_dev *add_device(
|
||||
dev->mtd.priv = dev;
|
||||
dev->mtd.owner = THIS_MODULE;
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
+ part->size = dev->mtd.size;
|
||||
+ if (mtd_device_register(&dev->mtd, part, 1)) {
|
||||
/* Device didn't get added, so free the entry */
|
||||
goto devinit_err;
|
||||
goto err_destroy_mutex;
|
||||
}
|
||||
list_add(&dev->list, &blkmtd_device_list);
|
||||
pr_info("mtd%d: [%s] erase_size = %dKiB [%d]\n",
|
||||
@@ -62,8 +62,8 @@
|
||||
+ mtdname, dev->mtd.erasesize >> 10, dev->mtd.erasesize);
|
||||
return dev;
|
||||
|
||||
devinit_err:
|
||||
@@ -347,9 +355,9 @@ static char block2mtd_paramline[80 + 12]
|
||||
err_destroy_mutex:
|
||||
@@ -353,9 +361,9 @@ static char block2mtd_paramline[80 + 12]
|
||||
|
||||
static int block2mtd_setup2(const char *val)
|
||||
{
|
||||
@@ -75,7 +75,7 @@
|
||||
char *name;
|
||||
size_t erase_size = PAGE_SIZE;
|
||||
int i, ret;
|
||||
@@ -362,7 +370,7 @@ static int block2mtd_setup2(const char *
|
||||
@@ -368,7 +376,7 @@ static int block2mtd_setup2(const char *
|
||||
strcpy(str, val);
|
||||
kill_final_newline(str);
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
token[i] = strsep(&str, ",");
|
||||
|
||||
if (str) {
|
||||
@@ -388,8 +396,10 @@ static int block2mtd_setup2(const char *
|
||||
@@ -394,8 +402,10 @@ static int block2mtd_setup2(const char *
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -96,7 +96,7 @@
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -423,7 +433,7 @@ static int block2mtd_setup(const char *v
|
||||
@@ -429,7 +439,7 @@ static int block2mtd_setup(const char *v
|
||||
|
||||
|
||||
module_param_call(block2mtd, block2mtd_setup, NULL, NULL, 0200);
|
||||
|
||||
Reference in New Issue
Block a user