All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND 1/2] MTD: autcpu12-nvram: Fix compile breakage
@ 2012-08-15 16:28 Alexander Shiyan
  2012-08-15 16:28 ` [PATCH RESEND 2/2] MTD: autcpu12-nvram: Convert driver to platform_device Alexander Shiyan
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Alexander Shiyan @ 2012-08-15 16:28 UTC (permalink / raw)
  To: linux-mtd
  Cc: Artem Bityutskiy, David Woodhouse, Alexander Shiyan,
	Arnd Bergmann

Update driver autcpu12-nvram.c so it compiles. map_read32/map_write32
are 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>
---
 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 e5bfd0e..0598d52 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 = {
 
 static int __init init_autcpu12_sram (void)
 {
-	int err, save0, save1;
+	map_word tmp, save0, save1;
+	int err;
 
 	autcpu12_sram_map.virt = ioremap(0x12000000, SZ_128K);
 	if (!autcpu12_sram_map.virt) {
@@ -51,7 +52,7 @@ static int __init init_autcpu12_sram (void)
 		err = -EIO;
 		goto out;
 	}
-	simple_map_init(&autcpu_sram_map);
+	simple_map_init(&autcpu12_sram_map);
 
 	/*
 	 * Check for 32K/128K
@@ -61,20 +62,22 @@ static int __init init_autcpu12_sram (void)
 	 * Read	and check result on ofs 0x0
 	 * Restore contents
 	 */
-	save0 = map_read32(&autcpu12_sram_map,0);
-	save1 = map_read32(&autcpu12_sram_map,0x10000);
-	map_write32(&autcpu12_sram_map,~save0,0x10000);
+	save0 = map_read(&autcpu12_sram_map, 0);
+	save1 = map_read(&autcpu12_sram_map, 0x10000);
+	tmp.x[0] = ~save0.x[0];
+	map_write(&autcpu12_sram_map, tmp, 0x10000);
 	/* if we find this pattern on 0x0, we have 32K size
 	 * restore contents and exit
 	 */
-	if ( map_read32(&autcpu12_sram_map,0) != save0) {
-		map_write32(&autcpu12_sram_map,save0,0x0);
+	tmp = map_read(&autcpu12_sram_map, 0);
+	if (!map_word_equal(&autcpu12_sram_map, tmp, save0)) {
+		map_write(&autcpu12_sram_map, save0, 0x0);
 		goto map;
 	}
 	/* We have a 128K found, restore 0x10000 and set size
 	 * to 128K
 	 */
-	map_write32(&autcpu12_sram_map,save1,0x10000);
+	map_write(&autcpu12_sram_map, save1, 0x10000);
 	autcpu12_sram_map.size = SZ_128K;
 
 map:
-- 
1.7.8.6

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-08-17 15:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-15 16:28 [PATCH RESEND 1/2] MTD: autcpu12-nvram: Fix compile breakage Alexander Shiyan
2012-08-15 16:28 ` [PATCH RESEND 2/2] MTD: autcpu12-nvram: Convert driver to platform_device Alexander Shiyan
2012-08-15 19:13   ` Arnd Bergmann
2012-08-17 12:40 ` [PATCH RESEND 1/2] MTD: autcpu12-nvram: Fix compile breakage Artem Bityutskiy
2012-08-17 14:51   ` Alexander Shiyan
2012-08-17 15:40 ` Artem Bityutskiy
2012-08-17 15:41   ` Alexander Shiyan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.