generic: allow to build myloader mtd parser for 3.2+
authorGabor Juhos <juhosg@openwrt.org>
Sun, 22 Jan 2012 18:36:49 +0000 (18:36 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Sun, 22 Jan 2012 18:36:49 +0000 (18:36 +0000)
SVN-Revision: 29858

target/linux/generic/files/drivers/mtd/myloader.c

index 51c037459ff9b6965ced16f244197bcddedf8f24..a13752dd9827f8c804a9cb2efe4a423fa0ce6dde 100644 (file)
@@ -14,6 +14,8 @@
  */
 
 #include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/version.h>
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/vmalloc.h>
@@ -30,9 +32,15 @@ struct part_data {
        char names[MYLO_MAX_PARTITIONS][PART_NAME_LEN];
 };
 
-int myloader_parse_partitions(struct mtd_info *master,
-                       struct mtd_partition **pparts,
-                       unsigned long origin)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
+static int myloader_parse_partitions(struct mtd_info *master,
+                                    struct mtd_partition **pparts,
+                                    struct mtd_part_parser_data *data)
+#else
+static int myloader_parse_partitions(struct mtd_info *master,
+                                    struct mtd_partition **pparts,
+                                    unsigned long origin)
+#endif
 {
        struct part_data *buf;
        struct mylo_partition_table *tab;