mtd: maps: sc520cdp: fix warnings

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Tue Jun 10 23:59:10 PDT 2014


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=3a9f76bdf365efdc869125f9f2386643007f997b
Commit:     3a9f76bdf365efdc869125f9f2386643007f997b
Parent:     ed491d2063d41a09a35c7db1a99fea88dbfcd7aa
Author:     Brian Norris <computersforpeace at gmail.com>
AuthorDate: Mon May 12 16:41:46 2014 -0700
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Wed May 28 00:05:24 2014 -0700

    mtd: maps: sc520cdp: fix warnings
    
    On m86k, and maybe a few other architectures, we get this kind of
    warning, due to misuse of volatile:
    
       drivers/mtd/maps/sc520cdp.c: In function 'sc520cdp_setup_par':
    >> drivers/mtd/maps/sc520cdp.c:223:2: warning: passing argument 1 of 'iounmap' discards 'volatile' qualifier from pointer target type [enabled by default]
       arch/m68k/include/asm/raw_io.h:22:13: note: expected 'void *' but argument is of type 'volatile long unsigned int *'
    
    Rather than annotating the variable declaration, let's just use the
    proper accessors, which add the 'volatile' qualifier to the operation.
    
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/maps/sc520cdp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/maps/sc520cdp.c b/drivers/mtd/maps/sc520cdp.c
index 8fead8e..093edd5 100644
--- a/drivers/mtd/maps/sc520cdp.c
+++ b/drivers/mtd/maps/sc520cdp.c
@@ -183,7 +183,7 @@ static const struct sc520_par_table par_table[NUM_FLASH_BANKS] =
 
 static void sc520cdp_setup_par(void)
 {
-	volatile unsigned long __iomem *mmcr;
+	unsigned long __iomem *mmcr;
 	unsigned long mmcr_val;
 	int i, j;
 
@@ -203,11 +203,11 @@ static void sc520cdp_setup_par(void)
 	*/
 	for(i = 0; i < NUM_FLASH_BANKS; i++) {		/* for each par_table entry  */
 		for(j = 0; j < NUM_SC520_PAR; j++) {	/* for each PAR register     */
-			mmcr_val = mmcr[SC520_PAR(j)];
+			mmcr_val = readl(&mmcr[SC520_PAR(j)]);
 			/* if target device field matches, reprogram the PAR */
 			if((mmcr_val & SC520_PAR_TRGDEV) == par_table[i].trgdev)
 			{
-				mmcr[SC520_PAR(j)] = par_table[i].new_par;
+				writel(par_table[i].new_par, &mmcr[SC520_PAR(j)]);
 				break;
 			}
 		}



More information about the linux-mtd-cvs mailing list