kernel/generic: modify mtd related patches for 3.14
authorHauke Mehrtens <hauke@hauke-m.de>
Thu, 8 May 2014 21:51:36 +0000 (21:51 +0000)
committerHauke Mehrtens <hauke@hauke-m.de>
Thu, 8 May 2014 21:51:36 +0000 (21:51 +0000)
Function register_mtd_parser always returned 0 (at least since v3.3)
before being changed to return void in v3.14-rc1~65^2~93 (mtd: make
register_mtd_parser return void), so it's not needed to check the
return value of this function. Also add __init flag to caller.

This fix compile errors in 3.14 kernel like:
drivers/mtd/mtdsplit_seama.c: In function 'mtdsplit_seama_init':
drivers/mtd/mtdsplit_seama.c:99:2: error: void value not ignored as it ought to be
  return register_mtd_parser(&mtdsplit_seama_parser);
  ^

Signed-off-by: Zhao, Gang <gamerh2o@gmail.com>
SVN-Revision: 40731

target/linux/generic/files/drivers/mtd/mtdsplit_lzma.c
target/linux/generic/files/drivers/mtd/mtdsplit_seama.c
target/linux/generic/files/drivers/mtd/mtdsplit_squashfs.c
target/linux/generic/files/drivers/mtd/mtdsplit_uimage.c
target/linux/generic/files/drivers/mtd/myloader.c

index d23060a7d597229b4f3e5fbf5cf3e2a0981a0656..64dc7cb31cbcd17501e0f1869ccced93f9ed769a 100644 (file)
@@ -86,10 +86,11 @@ static struct mtd_part_parser mtdsplit_lzma_parser = {
        .type = MTD_PARSER_TYPE_FIRMWARE,
 };
 
-static int
-mtdsplit_lzma_init(void)
+static int __init mtdsplit_lzma_init(void)
 {
-       return register_mtd_parser(&mtdsplit_lzma_parser);
+       register_mtd_parser(&mtdsplit_lzma_parser);
+
+       return 0;
 }
 
 subsys_initcall(mtdsplit_lzma_init);
index 7a2dc7d8553bf157d4cfe2d26e3d854012f0e03c..6f21f8fb58c44af38e9b3360cc3e2e0ba3a35e4f 100644 (file)
@@ -93,10 +93,11 @@ static struct mtd_part_parser mtdsplit_seama_parser = {
        .type = MTD_PARSER_TYPE_FIRMWARE,
 };
 
-static int
-mtdsplit_seama_init(void)
+static int __init mtdsplit_seama_init(void)
 {
-       return register_mtd_parser(&mtdsplit_seama_parser);
+       register_mtd_parser(&mtdsplit_seama_parser);
+
+       return 0;
 }
 
 subsys_initcall(mtdsplit_seama_init);
index 7953e8c382abffab7d0cc8e30036d44c5ca8aba7..3d80e078b5f5f1bdf4e181008e6799157ff62f09 100644 (file)
@@ -62,10 +62,11 @@ static struct mtd_part_parser mtdsplit_squashfs_parser = {
        .type = MTD_PARSER_TYPE_ROOTFS,
 };
 
-static int
-mtdsplit_squashfs_init(void)
+static int __init mtdsplit_squashfs_init(void)
 {
-       return register_mtd_parser(&mtdsplit_squashfs_parser);
+       register_mtd_parser(&mtdsplit_squashfs_parser);
+
+       return 0;
 }
 
 subsys_initcall(mtdsplit_squashfs_init);
index 94b22f67e26523b33a0e35d493c9a2876a1b4f0c..de55297870945fb2638483301b07fb096d6b4cd8 100644 (file)
@@ -271,23 +271,12 @@ static struct mtd_part_parser uimage_netgear_parser = {
        .type = MTD_PARSER_TYPE_FIRMWARE,
 };
 
-static int mtdsplit_uimage_init(void)
+static int __init mtdsplit_uimage_init(void)
 {
-       int ret;
-
-       ret = register_mtd_parser(&uimage_generic_parser);
-       if (ret)
-               return ret;
-
-       ret = register_mtd_parser(&uimage_netgear_parser);
-       if (ret)
-               goto err_unregister_generic;
+       register_mtd_parser(&uimage_generic_parser);
+       register_mtd_parser(&uimage_netgear_parser);
 
        return 0;
-
-err_unregister_generic:
-       deregister_mtd_parser(&uimage_generic_parser);
-       return ret;
 }
 
-module_init(mtdsplit_uimage_init);
\ No newline at end of file
+module_init(mtdsplit_uimage_init);
index 72956cdc1c9fa5ffafdeca73e941ffb20c7656e8..cd573690a7a83e3ae1511eaa6bd05d5d9c7f31b9 100644 (file)
@@ -164,7 +164,9 @@ static struct mtd_part_parser myloader_mtd_parser = {
 
 static int __init myloader_mtd_parser_init(void)
 {
-       return register_mtd_parser(&myloader_mtd_parser);
+       register_mtd_parser(&myloader_mtd_parser);
+
+       return 0;
 }
 
 static void __exit myloader_mtd_parser_exit(void)