+extern char *prom_getenv(char *name);
+
+static int create_mtd_partitions(void);
-+static void __exit ar7_mtd_cleanup(void);
++static void ar7_mtd_cleanup(void);
+
+#define MAX_NUM_PARTITIONS 5
+static struct mtd_partition ar7_partinfo[MAX_NUM_PARTITIONS];
+
+ ar7_partinfo[p].name = strdup("config");
+ ar7_partinfo[p].offset = config_offset;
-+ ar7_partinfo[p].size = WINDOW_SIZE - config_offset;
++ ar7_partinfo[p].size = ar7_mtd_info->size - config_offset;
+ ar7_partinfo[p++].mask_flags = 0;
+
+ if (ar7_read32(&ar7_map, rootfs_start) == SQUASHFS_MAGIC) {
+ int newsize, newoffset;
-+ squashfs_super_block sb;
++ struct squashfs_super_block sb;
+
+ ar7_copy_from(&ar7_map, &sb, rootfs_start, sizeof(sb));
+ printk("Squashfs detected (size = 0x%08x)\n", sb.bytes_used);
+
+ ar7_partinfo[p - 2].size = newoffset - rootfs_start;
+
-+ ar7_partinfo[p].name = strdup("OpenWrt");
++ ar7_partinfo[p].name = strdup("rootfs_data");
+ ar7_partinfo[p].offset = newoffset;
+ ar7_partinfo[p].size = config_offset - newoffset;
+ ar7_partinfo[p++].mask_flags = 0;
+ return p;
+}
+
-+static void __exit ar7_mtd_cleanup(void)
++static void ar7_mtd_cleanup(void)
+{
+ if (ar7_mtd_info) {
+ del_mtd_partitions(ar7_mtd_info);