Skip to content

Commit d419593

Browse files
shcgitgregkh
authored andcommitted
mtd: autcpu12-nvram: Fix compile breakage
commit d1f55c6 upstream. 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> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d7cced4 commit d419593

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

drivers/mtd/maps/autcpu12-nvram.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,16 @@ struct map_info autcpu12_sram_map = {
4343

4444
static int __init init_autcpu12_sram (void)
4545
{
46-
int err, save0, save1;
46+
map_word tmp, save0, save1;
47+
int err;
4748

4849
autcpu12_sram_map.virt = ioremap(0x12000000, SZ_128K);
4950
if (!autcpu12_sram_map.virt) {
5051
printk("Failed to ioremap autcpu12 NV-RAM space\n");
5152
err = -EIO;
5253
goto out;
5354
}
54-
simple_map_init(&autcpu_sram_map);
55+
simple_map_init(&autcpu12_sram_map);
5556

5657
/*
5758
* Check for 32K/128K
@@ -61,20 +62,22 @@ static int __init init_autcpu12_sram (void)
6162
* Read and check result on ofs 0x0
6263
* Restore contents
6364
*/
64-
save0 = map_read32(&autcpu12_sram_map,0);
65-
save1 = map_read32(&autcpu12_sram_map,0x10000);
66-
map_write32(&autcpu12_sram_map,~save0,0x10000);
65+
save0 = map_read(&autcpu12_sram_map, 0);
66+
save1 = map_read(&autcpu12_sram_map, 0x10000);
67+
tmp.x[0] = ~save0.x[0];
68+
map_write(&autcpu12_sram_map, tmp, 0x10000);
6769
/* if we find this pattern on 0x0, we have 32K size
6870
* restore contents and exit
6971
*/
70-
if ( map_read32(&autcpu12_sram_map,0) != save0) {
71-
map_write32(&autcpu12_sram_map,save0,0x0);
72+
tmp = map_read(&autcpu12_sram_map, 0);
73+
if (!map_word_equal(&autcpu12_sram_map, tmp, save0)) {
74+
map_write(&autcpu12_sram_map, save0, 0x0);
7275
goto map;
7376
}
7477
/* We have a 128K found, restore 0x10000 and set size
7578
* to 128K
7679
*/
77-
map_write32(&autcpu12_sram_map,save1,0x10000);
80+
map_write(&autcpu12_sram_map, save1, 0x10000);
7881
autcpu12_sram_map.size = SZ_128K;
7982

8083
map:

0 commit comments

Comments
 (0)