kernel/generic: modify mtd related patches for 3.14

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>


git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40731 3c298f89-4303-0410-b956-a3cf2f4a3e73
master
Hauke Mehrtens 2014-05-08 21:51:36 +00:00
parent d98e49d609
commit 3a2eca5351
5 changed files with 19 additions and 25 deletions

View 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);

View 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);

View 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);

View 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);
module_init(mtdsplit_uimage_init);

View 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)