aboutsummaryrefslogtreecommitdiffstats
path: root/lib/devres.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-03-18 02:44:31 -0400
committerDavid S. Miller <davem@davemloft.net>2008-03-18 02:44:31 -0400
commit2f633928cbba8a5858bb39b11e7219a41b0fbef5 (patch)
tree9a82f4b7f2c3afe4b0208d8e44ea61bae90a7d22 /lib/devres.c
parent5e226e4d9016daee170699f8a4188a5505021756 (diff)
parentbde4f8fa8db2abd5ac9c542d76012d0fedab050f (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'lib/devres.c')
-rw-r--r--lib/devres.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/devres.c b/lib/devres.c
index b1d336ce7f3d..edc27a5d1b73 100644
--- a/lib/devres.c
+++ b/lib/devres.c
@@ -298,6 +298,31 @@ int pcim_iomap_regions(struct pci_dev *pdev, u16 mask, const char *name)
298EXPORT_SYMBOL(pcim_iomap_regions); 298EXPORT_SYMBOL(pcim_iomap_regions);
299 299
300/** 300/**
301 * pcim_iomap_regions_request_all - Request all BARs and iomap specified ones
302 * @pdev: PCI device to map IO resources for
303 * @mask: Mask of BARs to iomap
304 * @name: Name used when requesting regions
305 *
306 * Request all PCI BARs and iomap regions specified by @mask.
307 */
308int pcim_iomap_regions_request_all(struct pci_dev *pdev, u16 mask,
309 const char *name)
310{
311 int request_mask = ((1 << 6) - 1) & ~mask;
312 int rc;
313
314 rc = pci_request_selected_regions(pdev, request_mask, name);
315 if (rc)
316 return rc;
317
318 rc = pcim_iomap_regions(pdev, mask, name);
319 if (rc)
320 pci_release_selected_regions(pdev, request_mask);
321 return rc;
322}
323EXPORT_SYMBOL(pcim_iomap_regions_request_all);
324
325/**
301 * pcim_iounmap_regions - Unmap and release PCI BARs 326 * pcim_iounmap_regions - Unmap and release PCI BARs
302 * @pdev: PCI device to map IO resources for 327 * @pdev: PCI device to map IO resources for
303 * @mask: Mask of BARs to unmap and release 328 * @mask: Mask of BARs to unmap and release