public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] misc patches
@ 2007-07-08 15:53 Rolf Eike Beer
  2007-07-08 15:56 ` [PATCH 1/4] Use kcalloc() in drivers/video/aty/atyfb_base.c Rolf Eike Beer
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Rolf Eike Beer @ 2007-07-08 15:53 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm

[-- Attachment #1: Type: text/plain, Size: 287 bytes --]

This are some random patches I've lying around here. They are not related to 
each other

1) Use kcalloc() in drivers/video/aty/atyfb_base.c
2) Initialize filp->private_data only once in em28xx_v4l2_open
3) [Doc] Fix typos in fs/sysfs/file.c
4) [Doc] Document pci_iomap()

Eike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* [PATCH 1/4] Use kcalloc() in drivers/video/aty/atyfb_base.c
  2007-07-08 15:53 [PATCH 0/4] misc patches Rolf Eike Beer
@ 2007-07-08 15:56 ` Rolf Eike Beer
  2007-07-08 16:03 ` [PATCH 2/4] Initialize filp->private_data only once in em28xx_v4l2_open Rolf Eike Beer
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Rolf Eike Beer @ 2007-07-08 15:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm

Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>

---
commit cc4a7b5dfee25083a6a5741b5b640ae2a1d3aa12
tree a4763216a61fa1501bf9b5dbb60f8860d1620b99
parent dcd9673a1ca36cb084de58f443edf42fd64b186b
author Rolf Eike Beer <eike-kernel@sf-tec.de> Mon, 07 Aug 2006 13:36:24 +0200
committer Rolf Eike Beer <eike-kernel@sf-tec.de> Mon, 07 Aug 2006 13:36:24 +0200

 drivers/video/aty/atyfb_base.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index 053ff63..6bc51bb 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -2995,12 +2995,11 @@ static int __devinit atyfb_setup_sparc(struct pci_dev *pdev,
 		/* nothing */ ;
 	j = i + 4;
 
-	par->mmap_map = kmalloc(j * sizeof(*par->mmap_map), GFP_ATOMIC);
+	par->mmap_map = kcalloc(j, sizeof(*par->mmap_map), GFP_ATOMIC);
 	if (!par->mmap_map) {
 		PRINTKE("atyfb_setup_sparc() can't alloc mmap_map\n");
 		return -ENOMEM;
 	}
-	memset(par->mmap_map, 0, j * sizeof(*par->mmap_map));
 
 	for (i = 0, j = 2; i < 6 && pdev->resource[i].start; i++) {
 		struct resource *rp = &pdev->resource[i];

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

* [PATCH 2/4] Initialize filp->private_data only once in em28xx_v4l2_open
  2007-07-08 15:53 [PATCH 0/4] misc patches Rolf Eike Beer
  2007-07-08 15:56 ` [PATCH 1/4] Use kcalloc() in drivers/video/aty/atyfb_base.c Rolf Eike Beer
@ 2007-07-08 16:03 ` Rolf Eike Beer
  2007-07-08 16:07 ` [PATCH 3/4][Doc] Fix typos in fs/sysfs/file.c Rolf Eike Beer
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Rolf Eike Beer @ 2007-07-08 16:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm

Some lines later filp->private_data is initialized to dev again. Since there
are some checks that might fail in the mean time keep the later version.

Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>

---
commit 7103e0b114b01a16d7c1ea71914d5069d974167d
tree 6b976d7ce4e872b32805d7df73dd13b5349d439f
parent 39c068bce1d63f6c1345c1ddfda1841d9fd20c74
author Rolf Eike Beer <eike-kernel@sf-tec.de> Tue, 25 Jul 2006 17:55:34 +0200
committer Rolf Eike Beer <eike-kernel@sf-tec.de> Tue, 25 Jul 2006 17:55:34 +0200

 drivers/media/video/em28xx/em28xx-video.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index 2a461dd..b2ae0c8 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -268,8 +268,6 @@ static int em28xx_v4l2_open(struct inode *inode, struct file *filp)
 	if (NULL == dev)
 		return -ENODEV;
 
-	filp->private_data=dev;
-
 	em28xx_videodbg("open minor=%d type=%s users=%d\n",
 				minor,v4l2_type_names[dev->type],dev->users);
 

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

* [PATCH 3/4][Doc] Fix typos in fs/sysfs/file.c
  2007-07-08 15:53 [PATCH 0/4] misc patches Rolf Eike Beer
  2007-07-08 15:56 ` [PATCH 1/4] Use kcalloc() in drivers/video/aty/atyfb_base.c Rolf Eike Beer
  2007-07-08 16:03 ` [PATCH 2/4] Initialize filp->private_data only once in em28xx_v4l2_open Rolf Eike Beer
@ 2007-07-08 16:07 ` Rolf Eike Beer
  2007-07-08 16:09 ` [PATCH 4/4][Doc] Document pci_iomap() Rolf Eike Beer
  2007-07-09 21:24 ` [PATCH 0/4] misc patches Randy Dunlap
  4 siblings, 0 replies; 10+ messages in thread
From: Rolf Eike Beer @ 2007-07-08 16:07 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, Randy Dunlap

Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>

---
commit 966fef8404d59056d8524bf94d7dff790fe1fa82
tree 1adc274bc9b8e7e420db0b0023c8b70bd294e84e
parent 0cbdc367b144a95709852c642a069ed652989520
author Rolf Eike Beer <eike-kernel@sf-tec.de> Mon, 21 May 2007 22:55:30 +0200
committer Rolf Eike Beer <eike-kernel@sf-tec.de> Mon, 21 May 2007 22:55:30 +0200

 fs/sysfs/file.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index b502c71..dcb8e83 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -370,7 +370,7 @@ static int sysfs_release(struct inode * inode, struct file * filp)
  * again will not get new data, or reset the state of 'poll'.
  * Reminder: this only works for attributes which actively support
  * it, and it is not possible to test an attribute from userspace
- * to see if it supports poll (Nether 'poll' or 'select' return
+ * to see if it supports poll (Neither 'poll' nor 'select' return
  * an appropriate error code).  When in doubt, set a suitable timeout value.
  */
 static unsigned int sysfs_poll(struct file *filp, poll_table *wait)

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

* [PATCH 4/4][Doc] Document pci_iomap()
  2007-07-08 15:53 [PATCH 0/4] misc patches Rolf Eike Beer
                   ` (2 preceding siblings ...)
  2007-07-08 16:07 ` [PATCH 3/4][Doc] Fix typos in fs/sysfs/file.c Rolf Eike Beer
@ 2007-07-08 16:09 ` Rolf Eike Beer
  2007-07-09 15:58   ` Randy Dunlap
  2007-07-09 21:24 ` [PATCH 0/4] misc patches Randy Dunlap
  4 siblings, 1 reply; 10+ messages in thread
From: Rolf Eike Beer @ 2007-07-08 16:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, Randy Dunlap

This useful interface is hardly mentioned anywhere in the in-tree
documentation.

Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>

---
commit 2cb2450818804edcbcb1486a4df0db06e5d49969
tree 2c53fbd2e0be832767446a8684561200b437a695
parent 288a3f1fd00365669ed9ad725b15ff67004cee0a
author Rolf Eike Beer <eike-kernel@sf-tec.de> Mon, 14 Aug 2006 14:20:30 +0200
committer Rolf Eike Beer <eike-kernel@sf-tec.de> Mon, 14 Aug 2006 14:20:30 +0200

 Documentation/DocBook/deviceiobook.tmpl |    1 +
 include/asm-i386/io.h                   |    3 +++
 lib/iomap.c                             |   15 ++++++++++++++-
 3 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/Documentation/DocBook/deviceiobook.tmpl b/Documentation/DocBook/deviceiobook.tmpl
index 90ed23d..4f85515 100644
--- a/Documentation/DocBook/deviceiobook.tmpl
+++ b/Documentation/DocBook/deviceiobook.tmpl
@@ -317,6 +317,7 @@ CPU B:  spin_unlock_irqrestore(&amp;dev_lock, flags)
   <chapter id="pubfunctions">
      <title>Public Functions Provided</title>
 !Einclude/asm-i386/io.h
+!Elib/iomap.c
   </chapter>
 
 </book>
diff --git a/include/asm-i386/io.h b/include/asm-i386/io.h
index b3724fe..e176483 100644
--- a/include/asm-i386/io.h
+++ b/include/asm-i386/io.h
@@ -112,6 +112,9 @@ extern void __iomem * __ioremap(unsigned long offset, unsigned long size, unsign
  * writew/writel functions and the other mmio helpers. The returned
  * address is not guaranteed to be usable directly as a virtual
  * address. 
+ *
+ * If the area you are trying to map is a PCI BAR you should have a
+ * look on pci_iomap().
  */
 
 static inline void __iomem * ioremap(unsigned long offset, unsigned long size)
diff --git a/lib/iomap.c b/lib/iomap.c
index 55689c5..8de891d 100644
--- a/lib/iomap.c
+++ b/lib/iomap.c
@@ -202,7 +202,20 @@ void ioport_unmap(void __iomem *addr)
 EXPORT_SYMBOL(ioport_map);
 EXPORT_SYMBOL(ioport_unmap);
 
-/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
+/**
+ * pci_iomap - create a virtual mapping cookie for a PCI BAR
+ * @dev: PCI device that owns the BAR
+ * @bar: BAR number
+ * @maxlen: length of the memory to map
+ *
+ * Using this function you will get a __iomem address to your device BAR.
+ * You can access it using ioread*() and iowrite*(). These functions hide 
+ * the details if this is a MMIO or PIO address space and will just do what 
+ * you expect from them in the correct way.
+ *
+ * @maxlen specifies the maximum length to map. If you want to get access to 
+ * the complete BAR without checking for their length first pass %0 here.
+ **/
 void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
 {
 	unsigned long start = pci_resource_start(dev, bar);

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

* Re: [PATCH 4/4][Doc] Document pci_iomap()
  2007-07-08 16:09 ` [PATCH 4/4][Doc] Document pci_iomap() Rolf Eike Beer
@ 2007-07-09 15:58   ` Randy Dunlap
  2007-07-10  9:11     ` [PATCH][Doc] " Rolf Eike Beer
  0 siblings, 1 reply; 10+ messages in thread
From: Randy Dunlap @ 2007-07-09 15:58 UTC (permalink / raw)
  To: Rolf Eike Beer, matthew; +Cc: linux-kernel, akpm, Randy Dunlap

On Sun, 8 Jul 2007 18:09:19 +0200 Rolf Eike Beer wrote:

> This useful interface is hardly mentioned anywhere in the in-tree
> documentation.
> 
> Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>

Hi Rolf,

quilt says:

Warning: trailing whitespace in lines 250,251,254 of lib/iomap.c

> ---
> commit 2cb2450818804edcbcb1486a4df0db06e5d49969
> tree 2c53fbd2e0be832767446a8684561200b437a695
> parent 288a3f1fd00365669ed9ad725b15ff67004cee0a
> author Rolf Eike Beer <eike-kernel@sf-tec.de> Mon, 14 Aug 2006 14:20:30 +0200
> committer Rolf Eike Beer <eike-kernel@sf-tec.de> Mon, 14 Aug 2006 14:20:30 +0200
> 
>  Documentation/DocBook/deviceiobook.tmpl |    1 +
>  include/asm-i386/io.h                   |    3 +++
>  lib/iomap.c                             |   15 ++++++++++++++-
>  3 files changed, 18 insertions(+), 1 deletions(-)
> 
> diff --git a/Documentation/DocBook/deviceiobook.tmpl b/Documentation/DocBook/deviceiobook.tmpl
> index 90ed23d..4f85515 100644
> --- a/Documentation/DocBook/deviceiobook.tmpl
> +++ b/Documentation/DocBook/deviceiobook.tmpl
> @@ -317,6 +317,7 @@ CPU B:  spin_unlock_irqrestore(&amp;dev_lock, flags)
>    <chapter id="pubfunctions">
>       <title>Public Functions Provided</title>
>  !Einclude/asm-i386/io.h

Weird.  After applying this patch, I am getting this kdoc warning:

  DOCPROC Documentation/DocBook/deviceiobook.xml
Warning(/var/linsrc/linux-2.6.22//include/asm-i386/io.h): no structured comments found

but the warning is not correct... :(
Oh, the !E should be !I for the io.h file.
Would you correct that also?  :)


> +!Elib/iomap.c
>    </chapter>
>  
>  </book>
> diff --git a/include/asm-i386/io.h b/include/asm-i386/io.h
> index b3724fe..e176483 100644
> --- a/include/asm-i386/io.h
> +++ b/include/asm-i386/io.h
> @@ -112,6 +112,9 @@ extern void __iomem * __ioremap(unsigned long offset, unsigned long size, unsign
>   * writew/writel functions and the other mmio helpers. The returned
>   * address is not guaranteed to be usable directly as a virtual
>   * address. 
> + *
> + * If the area you are trying to map is a PCI BAR you should have a
> + * look on pci_iomap().

      look at

>   */
>  
>  static inline void __iomem * ioremap(unsigned long offset, unsigned long size)
> diff --git a/lib/iomap.c b/lib/iomap.c
> index 55689c5..8de891d 100644
> --- a/lib/iomap.c
> +++ b/lib/iomap.c
> @@ -202,7 +202,20 @@ void ioport_unmap(void __iomem *addr)
>  EXPORT_SYMBOL(ioport_map);
>  EXPORT_SYMBOL(ioport_unmap);
>  
> -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
> +/**
> + * pci_iomap - create a virtual mapping cookie for a PCI BAR
> + * @dev: PCI device that owns the BAR
> + * @bar: BAR number
> + * @maxlen: length of the memory to map
> + *
> + * Using this function you will get a __iomem address to your device BAR.
> + * You can access it using ioread*() and iowrite*(). These functions hide 
> + * the details if this is a MMIO or PIO address space and will just do what 
> + * you expect from them in the correct way.
> + *
> + * @maxlen specifies the maximum length to map. If you want to get access to 
> + * the complete BAR without checking for their length first pass %0 here.

s/their/its/
s/first/first,/

> + **/
>  void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
>  {
>  	unsigned long start = pci_resource_start(dev, bar);
> 

Please make these minor corrections.  Looks good to me.
Matthew, OK with you?

Thanks.
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

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

* Re: [PATCH 0/4] misc patches
  2007-07-08 15:53 [PATCH 0/4] misc patches Rolf Eike Beer
                   ` (3 preceding siblings ...)
  2007-07-08 16:09 ` [PATCH 4/4][Doc] Document pci_iomap() Rolf Eike Beer
@ 2007-07-09 21:24 ` Randy Dunlap
  2007-07-09 21:27   ` Andrew Morton
  4 siblings, 1 reply; 10+ messages in thread
From: Randy Dunlap @ 2007-07-09 21:24 UTC (permalink / raw)
  To: Rolf Eike Beer; +Cc: linux-kernel, akpm

On Sun, 8 Jul 2007 17:53:56 +0200 Rolf Eike Beer wrote:

> This are some random patches I've lying around here. They are not related to 
> each other
> 
> 1) Use kcalloc() in drivers/video/aty/atyfb_base.c
> 2) Initialize filp->private_data only once in em28xx_v4l2_open
> 3) [Doc] Fix typos in fs/sysfs/file.c
> 4) [Doc] Document pci_iomap()

Hi,

Please don't make unrelated/random patches look like a patch series.

>From Documentation/SubmittingPatches:

(where a "patch series" is an ordered sequence of multiple,
related patches)

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

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

* Re: [PATCH 0/4] misc patches
  2007-07-09 21:24 ` [PATCH 0/4] misc patches Randy Dunlap
@ 2007-07-09 21:27   ` Andrew Morton
  0 siblings, 0 replies; 10+ messages in thread
From: Andrew Morton @ 2007-07-09 21:27 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Rolf Eike Beer, linux-kernel

On Mon, 9 Jul 2007 14:24:17 -0700
Randy Dunlap <rdunlap@xenotime.net> wrote:

> On Sun, 8 Jul 2007 17:53:56 +0200 Rolf Eike Beer wrote:
> 
> > This are some random patches I've lying around here. They are not related to 
> > each other
> > 
> > 1) Use kcalloc() in drivers/video/aty/atyfb_base.c
> > 2) Initialize filp->private_data only once in em28xx_v4l2_open
> > 3) [Doc] Fix typos in fs/sysfs/file.c
> > 4) [Doc] Document pci_iomap()
> 
> Hi,
> 
> Please don't make unrelated/random patches look like a patch series.
> 

I tend to have a big panic if sent a pile of patches which have no sequence
numbering.  So if they are all unrelated, please tell me so.


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

* [PATCH][Doc] Document pci_iomap()
  2007-07-09 15:58   ` Randy Dunlap
@ 2007-07-10  9:11     ` Rolf Eike Beer
  2007-07-10 15:24       ` Randy Dunlap
  0 siblings, 1 reply; 10+ messages in thread
From: Rolf Eike Beer @ 2007-07-10  9:11 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: matthew, linux-kernel, akpm

This useful interface is hardly mentioned anywhere in the in-tree
documentation.

Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>

---
commit bdf4a23b9b1ff4be79a6f9b863f7203dba2dc808
tree a53c4a6c90e13d55fbf2a0b40cd9676bd9a5d0e5
parent 33738cbb6555861de1dce626c913fad06ce658cc
author Rolf Eike Beer <eike-kernel@sf-tec.de> Tue, 10 Jul 2007 11:08:51 +0200
committer Rolf Eike Beer <eike-kernel@sf-tec.de> Tue, 10 Jul 2007 11:08:51 +0200

 Documentation/DocBook/deviceiobook.tmpl |    3 ++-
 include/asm-i386/io.h                   |    3 +++
 lib/iomap.c                             |   15 ++++++++++++++-
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/Documentation/DocBook/deviceiobook.tmpl b/Documentation/DocBook/deviceiobook.tmpl
index 90ed23d..c917de6 100644
--- a/Documentation/DocBook/deviceiobook.tmpl
+++ b/Documentation/DocBook/deviceiobook.tmpl
@@ -316,7 +316,8 @@ CPU B:  spin_unlock_irqrestore(&amp;dev_lock, flags)
 
   <chapter id="pubfunctions">
      <title>Public Functions Provided</title>
-!Einclude/asm-i386/io.h
+!Iinclude/asm-i386/io.h
+!Elib/iomap.c
   </chapter>
 
 </book>
diff --git a/include/asm-i386/io.h b/include/asm-i386/io.h
index e797586..c48ef18 100644
--- a/include/asm-i386/io.h
+++ b/include/asm-i386/io.h
@@ -112,6 +112,9 @@ extern void __iomem * __ioremap(unsigned long offset, unsigned long size, unsign
  * writew/writel functions and the other mmio helpers. The returned
  * address is not guaranteed to be usable directly as a virtual
  * address. 
+ *
+ * If the area you are trying to map is a PCI BAR you should have a
+ * look at pci_iomap().
  */
 
 static inline void __iomem * ioremap(unsigned long offset, unsigned long size)
diff --git a/lib/iomap.c b/lib/iomap.c
index a57d262..864f2ec 100644
--- a/lib/iomap.c
+++ b/lib/iomap.c
@@ -240,7 +240,20 @@ void ioport_unmap(void __iomem *addr)
 EXPORT_SYMBOL(ioport_map);
 EXPORT_SYMBOL(ioport_unmap);
 
-/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
+/**
+ * pci_iomap - create a virtual mapping cookie for a PCI BAR
+ * @dev: PCI device that owns the BAR
+ * @bar: BAR number
+ * @maxlen: length of the memory to map
+ *
+ * Using this function you will get a __iomem address to your device BAR.
+ * You can access it using ioread*() and iowrite*(). These functions hide
+ * the details if this is a MMIO or PIO address space and will just do what
+ * you expect from them in the correct way.
+ *
+ * @maxlen specifies the maximum length to map. If you want to get access to
+ * the complete BAR without checking for its length first, pass %0 here.
+ * */
 void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
 {
 	unsigned long start = pci_resource_start(dev, bar);

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

* Re: [PATCH][Doc] Document pci_iomap()
  2007-07-10  9:11     ` [PATCH][Doc] " Rolf Eike Beer
@ 2007-07-10 15:24       ` Randy Dunlap
  0 siblings, 0 replies; 10+ messages in thread
From: Randy Dunlap @ 2007-07-10 15:24 UTC (permalink / raw)
  To: Rolf Eike Beer; +Cc: matthew, linux-kernel, akpm

On Tue, 10 Jul 2007 11:11:28 +0200 Rolf Eike Beer wrote:

> This useful interface is hardly mentioned anywhere in the in-tree
> documentation.
> 
> Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>

Acked-by: Randy Dunlap <randy.dunlap@oracle.com>

> ---
> commit bdf4a23b9b1ff4be79a6f9b863f7203dba2dc808
> tree a53c4a6c90e13d55fbf2a0b40cd9676bd9a5d0e5
> parent 33738cbb6555861de1dce626c913fad06ce658cc
> author Rolf Eike Beer <eike-kernel@sf-tec.de> Tue, 10 Jul 2007 11:08:51 +0200
> committer Rolf Eike Beer <eike-kernel@sf-tec.de> Tue, 10 Jul 2007 11:08:51 +0200
> 
>  Documentation/DocBook/deviceiobook.tmpl |    3 ++-
>  include/asm-i386/io.h                   |    3 +++
>  lib/iomap.c                             |   15 ++++++++++++++-
>  3 files changed, 19 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/DocBook/deviceiobook.tmpl b/Documentation/DocBook/deviceiobook.tmpl
> index 90ed23d..c917de6 100644
> --- a/Documentation/DocBook/deviceiobook.tmpl
> +++ b/Documentation/DocBook/deviceiobook.tmpl
> @@ -316,7 +316,8 @@ CPU B:  spin_unlock_irqrestore(&amp;dev_lock, flags)
>  
>    <chapter id="pubfunctions">
>       <title>Public Functions Provided</title>
> -!Einclude/asm-i386/io.h
> +!Iinclude/asm-i386/io.h
> +!Elib/iomap.c
>    </chapter>
>  
>  </book>
> diff --git a/include/asm-i386/io.h b/include/asm-i386/io.h
> index e797586..c48ef18 100644
> --- a/include/asm-i386/io.h
> +++ b/include/asm-i386/io.h
> @@ -112,6 +112,9 @@ extern void __iomem * __ioremap(unsigned long offset, unsigned long size, unsign
>   * writew/writel functions and the other mmio helpers. The returned
>   * address is not guaranteed to be usable directly as a virtual
>   * address. 
> + *
> + * If the area you are trying to map is a PCI BAR you should have a
> + * look at pci_iomap().
>   */
>  
>  static inline void __iomem * ioremap(unsigned long offset, unsigned long size)
> diff --git a/lib/iomap.c b/lib/iomap.c
> index a57d262..864f2ec 100644
> --- a/lib/iomap.c
> +++ b/lib/iomap.c
> @@ -240,7 +240,20 @@ void ioport_unmap(void __iomem *addr)
>  EXPORT_SYMBOL(ioport_map);
>  EXPORT_SYMBOL(ioport_unmap);
>  
> -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
> +/**
> + * pci_iomap - create a virtual mapping cookie for a PCI BAR
> + * @dev: PCI device that owns the BAR
> + * @bar: BAR number
> + * @maxlen: length of the memory to map
> + *
> + * Using this function you will get a __iomem address to your device BAR.
> + * You can access it using ioread*() and iowrite*(). These functions hide
> + * the details if this is a MMIO or PIO address space and will just do what
> + * you expect from them in the correct way.
> + *
> + * @maxlen specifies the maximum length to map. If you want to get access to
> + * the complete BAR without checking for its length first, pass %0 here.
> + * */
>  void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
>  {
>  	unsigned long start = pci_resource_start(dev, bar);
> -

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

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

end of thread, other threads:[~2007-07-10 15:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-08 15:53 [PATCH 0/4] misc patches Rolf Eike Beer
2007-07-08 15:56 ` [PATCH 1/4] Use kcalloc() in drivers/video/aty/atyfb_base.c Rolf Eike Beer
2007-07-08 16:03 ` [PATCH 2/4] Initialize filp->private_data only once in em28xx_v4l2_open Rolf Eike Beer
2007-07-08 16:07 ` [PATCH 3/4][Doc] Fix typos in fs/sysfs/file.c Rolf Eike Beer
2007-07-08 16:09 ` [PATCH 4/4][Doc] Document pci_iomap() Rolf Eike Beer
2007-07-09 15:58   ` Randy Dunlap
2007-07-10  9:11     ` [PATCH][Doc] " Rolf Eike Beer
2007-07-10 15:24       ` Randy Dunlap
2007-07-09 21:24 ` [PATCH 0/4] misc patches Randy Dunlap
2007-07-09 21:27   ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox