uio: support memory sizes larger than 32 bits
authorCristian Stoica <cristian.stoica@freescale.com>
Thu, 9 Oct 2014 12:00:27 +0000 (15:00 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Nov 2014 18:09:07 +0000 (10:09 -0800)
This is a completion to 27a90700a4275c5178b883b65927affdafa5185c
The size field is also increased to allow values larger than 32 bits
on platforms that have more than 32 bit physical addresses.

Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/DocBook/uio-howto.tmpl
drivers/uio/uio.c
include/linux/uio_driver.h

index bbe9c1fd5cef013f1de5d0720d45c7feb022caf3..1fdc246e425614b3e9ea2096de11e44ea728e904 100644 (file)
@@ -540,7 +540,7 @@ appears in sysfs.
 </para></listitem>
 
 <listitem><para>
-<varname>unsigned long size</varname>: Fill in the size of the
+<varname>resource_size_t size</varname>: Fill in the size of the
 memory block that <varname>addr</varname> points to. If <varname>size</varname>
 is zero, the mapping is considered unused. Note that you
 <emphasis>must</emphasis> initialize <varname>size</varname> with zero for
index 60fa6278fbceffd460890de52e50c9c31ade080c..6276f13e9e126f8085fdc8949d0d8b784e4df14e 100644 (file)
@@ -56,12 +56,12 @@ static ssize_t map_name_show(struct uio_mem *mem, char *buf)
 
 static ssize_t map_addr_show(struct uio_mem *mem, char *buf)
 {
-       return sprintf(buf, "0x%llx\n", (unsigned long long)mem->addr);
+       return sprintf(buf, "%pa\n", &mem->addr);
 }
 
 static ssize_t map_size_show(struct uio_mem *mem, char *buf)
 {
-       return sprintf(buf, "0x%lx\n", mem->size);
+       return sprintf(buf, "%pa\n", &mem->size);
 }
 
 static ssize_t map_offset_show(struct uio_mem *mem, char *buf)
index baa81718d985afd9e90d70e90f18e66f96da5f8d..32c0e83d62397355e1b6bb804c1d0381f56daca1 100644 (file)
@@ -35,7 +35,7 @@ struct uio_map;
 struct uio_mem {
        const char              *name;
        phys_addr_t             addr;
-       unsigned long           size;
+       resource_size_t         size;
        int                     memtype;
        void __iomem            *internal_addr;
        struct uio_map          *map;