]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: introduce an pci_ioremap(pdev, barnr) function
authorArjan van de Ven <arjan@infradead.org>
Sun, 28 Sep 2008 23:36:11 +0000 (16:36 -0700)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Mon, 20 Oct 2008 18:01:48 +0000 (11:01 -0700)
commitb5020a16f5b7cd456714de5c4d4ef1077f1f5f09
tree2fb140d3c6e3924b6c91e736df327d6668d68b2a
parent8672638b77fcf7672db013006e6eba037a2e4511
PCI: introduce an pci_ioremap(pdev, barnr) function

A common thing in many PCI drivers is to ioremap() an entire bar.  This
is a slightly fragile thing right now, needing both an address and a
size, and many driver writers do.. various things there.

This patch introduces an pci_ioremap() function taking just a PCI device
struct and the bar number as arguments, and figures this all out itself,
in one place.  In addition, we can add various sanity checks to this
function (the patch already checks to make sure that the bar in question
really is a MEM bar; few to no drivers do that sort of thing).

Hopefully with this type of API we get less chance of mistakes in
drivers with ioremap() operations.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
include/linux/pci.h