RE: [PATCH] mtdnand.tmpl: ioremap() returns a void __iomem *

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday, December 11, 2009 1:23 PM, Randy Dunlap wrote:
> On Thu, 10 Dec 2009 19:34:08 -0500 H Hartley Sweeten wrote:
>
>> ioremap() returns a void __iomem * not an unsigned long.  Update the
>> Documentation file to reflect this.
>> 
>> Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
>> 
>> ---
>> 
>> diff --git a/Documentation/DocBook/mtdnand.tmpl b/Documentation/DocBook/mtdnand.tmpl
>> index f508a8a..04955da 100644
>> --- a/Documentation/DocBook/mtdnand.tmpl
>> +++ b/Documentation/DocBook/mtdnand.tmpl
>> @@ -174,7 +174,7 @@
>>  		</para>
>>  		<programlisting>
>>  static struct mtd_info *board_mtd;
>> -static unsigned long baseaddr;
>> +static void __iomem *baseaddr;
>>  		</programlisting>
>>  		<para>
>>  			Static example
>> @@ -182,7 +182,7 @@ static unsigned long baseaddr;
>>  		<programlisting>
>>  static struct mtd_info board_mtd;
>>  static struct nand_chip board_chip;
>> -static unsigned long baseaddr;
>> +static void iomem *baseaddr;
>
>               __iomem ??

Oops.. My bad, following is the updated patch.



ioremap() returns a void __iomem * not an unsigned long.  Update the
Documentation file to reflect this.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>

---

diff --git a/Documentation/DocBook/mtdnand.tmpl b/Documentation/DocBook/mtdnand.tmpl
index f508a8a..5e7d84b 100644
--- a/Documentation/DocBook/mtdnand.tmpl
+++ b/Documentation/DocBook/mtdnand.tmpl
@@ -174,7 +174,7 @@
 		</para>
 		<programlisting>
 static struct mtd_info *board_mtd;
-static unsigned long baseaddr;
+static void __iomem *baseaddr;
 		</programlisting>
 		<para>
 			Static example
@@ -182,7 +182,7 @@ static unsigned long baseaddr;
 		<programlisting>
 static struct mtd_info board_mtd;
 static struct nand_chip board_chip;
-static unsigned long baseaddr;
+static void __iomem *baseaddr;
 		</programlisting>
 	</sect1>
 	<sect1 id="Partition_defines">
@@ -283,8 +283,8 @@ int __init board_init (void)
 	}
 
 	/* map physical address */
-	baseaddr = (unsigned long)ioremap(CHIP_PHYSICAL_ADDRESS, 1024);
-	if(!baseaddr){
+	baseaddr = ioremap(CHIP_PHYSICAL_ADDRESS, 1024);
+	if (!baseaddr) {
 		printk("Ioremap to access NAND chip failed\n");
 		err = -EIO;
 		goto out_mtd;
@@ -316,7 +316,7 @@ int __init board_init (void)
 	goto out;
 
 out_ior:
-	iounmap((void *)baseaddr);
+	iounmap(baseaddr);
 out_mtd:
 	kfree (board_mtd);
 out:
@@ -341,7 +341,7 @@ static void __exit board_cleanup (void)
 	nand_release (board_mtd);
 
 	/* unmap physical address */
-	iounmap((void *)baseaddr);
+	iounmap(baseaddr);
 	
 	/* Free the MTD device structure */
 	kfree (board_mtd); 
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux