• A
    PCI: introduce an pci_ioremap(pdev, barnr) function · aa42d7c6
    Arjan van de Ven 提交于
    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: NArjan van de Ven <arjan@linux.intel.com>
    Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
    aa42d7c6
pci.h 37.2 KB