diff options
author | Alexander Shiyan <shc_work@mail.ru> | 2012-08-15 12:28:05 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-09-29 09:54:55 -0400 |
commit | d1f55c680e5d021e7066f4461dd678d42af18898 (patch) | |
tree | 473738efb977f680e1fb75077d9960247637a910 /drivers/mtd/maps | |
parent | 4cacbe226f39061f3e6730a08e3323e04a0de03f (diff) |
mtd: autcpu12-nvram: Fix compile breakage
Update driver autcpu12-nvram.c so it compiles; map_read32/map_write32
no longer exist in the kernel so the driver is totally broken.
Additionally, map_info name passed to simple_map_init is incorrect.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Cc: stable@vger.kernel.org
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/maps')
-rw-r--r-- | drivers/mtd/maps/autcpu12-nvram.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/mtd/maps/autcpu12-nvram.c b/drivers/mtd/maps/autcpu12-nvram.c index e5bfd0e093bb..0598d52eaf9f 100644 --- a/drivers/mtd/maps/autcpu12-nvram.c +++ b/drivers/mtd/maps/autcpu12-nvram.c | |||
@@ -43,7 +43,8 @@ struct map_info autcpu12_sram_map = { | |||
43 | 43 | ||
44 | static int __init init_autcpu12_sram (void) | 44 | static int __init init_autcpu12_sram (void) |
45 | { | 45 | { |
46 | int err, save0, save1; | 46 | map_word tmp, save0, save1; |
47 | int err; | ||
47 | 48 | ||
48 | autcpu12_sram_map.virt = ioremap(0x12000000, SZ_128K); | 49 | autcpu12_sram_map.virt = ioremap(0x12000000, SZ_128K); |
49 | if (!autcpu12_sram_map.virt) { | 50 | if (!autcpu12_sram_map.virt) { |
@@ -51,7 +52,7 @@ static int __init init_autcpu12_sram (void) | |||
51 | err = -EIO; | 52 | err = -EIO; |
52 | goto out; | 53 | goto out; |
53 | } | 54 | } |
54 | simple_map_init(&autcpu_sram_map); | 55 | simple_map_init(&autcpu12_sram_map); |
55 | 56 | ||
56 | /* | 57 | /* |
57 | * Check for 32K/128K | 58 | * Check for 32K/128K |
@@ -61,20 +62,22 @@ static int __init init_autcpu12_sram (void) | |||
61 | * Read and check result on ofs 0x0 | 62 | * Read and check result on ofs 0x0 |
62 | * Restore contents | 63 | * Restore contents |
63 | */ | 64 | */ |
64 | save0 = map_read32(&autcpu12_sram_map,0); | 65 | save0 = map_read(&autcpu12_sram_map, 0); |
65 | save1 = map_read32(&autcpu12_sram_map,0x10000); | 66 | save1 = map_read(&autcpu12_sram_map, 0x10000); |
66 | map_write32(&autcpu12_sram_map,~save0,0x10000); | 67 | tmp.x[0] = ~save0.x[0]; |
68 | map_write(&autcpu12_sram_map, tmp, 0x10000); | ||
67 | /* if we find this pattern on 0x0, we have 32K size | 69 | /* if we find this pattern on 0x0, we have 32K size |
68 | * restore contents and exit | 70 | * restore contents and exit |
69 | */ | 71 | */ |
70 | if ( map_read32(&autcpu12_sram_map,0) != save0) { | 72 | tmp = map_read(&autcpu12_sram_map, 0); |
71 | map_write32(&autcpu12_sram_map,save0,0x0); | 73 | if (!map_word_equal(&autcpu12_sram_map, tmp, save0)) { |
74 | map_write(&autcpu12_sram_map, save0, 0x0); | ||
72 | goto map; | 75 | goto map; |
73 | } | 76 | } |
74 | /* We have a 128K found, restore 0x10000 and set size | 77 | /* We have a 128K found, restore 0x10000 and set size |
75 | * to 128K | 78 | * to 128K |
76 | */ | 79 | */ |
77 | map_write32(&autcpu12_sram_map,save1,0x10000); | 80 | map_write(&autcpu12_sram_map, save1, 0x10000); |
78 | autcpu12_sram_map.size = SZ_128K; | 81 | autcpu12_sram_map.size = SZ_128K; |
79 | 82 | ||
80 | map: | 83 | map: |