1 --- a/drivers/mtd/maps/adm8668.c
2 +++ b/drivers/mtd/maps/adm8668.c
4 #include <linux/mtd/mtd.h>
5 #include <linux/mtd/map.h>
6 #include <linux/slab.h>
7 -#ifdef CONFIG_MTD_PARTITIONS
8 #include <linux/mtd/partitions.h>
10 #include <linux/crc32.h>
11 #include <linux/magic.h>
13 @@ -94,8 +92,6 @@ struct map_info adm8668_map = {
17 -#ifdef CONFIG_MTD_PARTITIONS
20 * Copied from mtdblock.c
22 @@ -238,7 +234,12 @@ init_mtd_partitions(struct mtd_info *mtd
25 if (be32_to_cpu(uhdr.ih_size) != (linux_len - sizeof(uhdr))) {
26 - unsigned char *block, *data = (unsigned char *)(WINDOW_ADDR | (adm8668_parts[PART_LINUX].offset + sizeof(struct uboot_header)) | 0xA0000000);
27 + unsigned char *block, *data;
28 + unsigned int offset;
30 + offset = adm8668_parts[PART_LINUX].offset +
31 + sizeof(struct uboot_header);
32 + data = (unsigned char *)(WINDOW_ADDR | 0xA0000000 | offset);
34 printk(KERN_NOTICE "Updating U-boot image:\n");
35 printk(KERN_NOTICE " old: [size: %8d crc32: 0x%08x]\n",
36 @@ -279,16 +280,11 @@ init_mtd_partitions(struct mtd_info *mtd
43 int __init init_adm8668_map(void)
45 -#ifdef CONFIG_MTD_PARTITIONS
49 - adm8668_map.virt = (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE);
50 + adm8668_map.virt = ioremap(WINDOW_ADDR, WINDOW_SIZE);
52 if (!adm8668_map.virt) {
53 printk(KERN_ERR "Failed to ioremap\n");
54 @@ -304,14 +300,12 @@ int __init init_adm8668_map(void)
56 adm8668_mtd->owner = THIS_MODULE;
58 -#ifdef CONFIG_MTD_PARTITIONS
59 nr_parts = init_mtd_partitions(adm8668_mtd, adm8668_mtd->size);
60 - ret = add_mtd_partitions(adm8668_mtd, adm8668_parts, nr_parts);
61 + ret = mtd_device_register(adm8668_mtd, adm8668_parts, nr_parts);
63 - printk(KERN_ERR "Flash: add_mtd_partitions failed\n");
64 + printk(KERN_ERR "Flash: mtd_device_register failed\n");
71 @@ -326,9 +320,7 @@ int __init init_adm8668_map(void)
73 void __exit cleanup_adm8668_map(void)
75 -#ifdef CONFIG_MTD_PARTITIONS
76 - del_mtd_partitions(adm8668_mtd);
78 + mtd_device_unregister(adm8668_mtd);
79 map_destroy(adm8668_mtd);
80 iounmap((void *) adm8668_map.virt);