From: Eli Billauer <eli.billauer@gmail.com>
To: tj@kernel.org
Cc: devel@driverdev.osuosl.org, gregkh@linuxfoundation.org,
bhelgaas@google.com, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org, Eli Billauer <eli.billauer@gmail.com>
Subject: [PATCH 3/3] dma-mapping: pci: Add devm_ interface for pci_map_single
Date: Sat, 17 May 2014 15:22:25 +0300 [thread overview]
Message-ID: <1400329345-15556-3-git-send-email-eli.billauer@gmail.com> (raw)
In-Reply-To: <1400329345-15556-1-git-send-email-eli.billauer@gmail.com>
Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
---
Documentation/driver-model/devres.txt | 2 ++
include/asm-generic/pci-dma-compat.h | 17 +++++++++++++++++
2 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/Documentation/driver-model/devres.txt b/Documentation/driver-model/devres.txt
index 2112a00..fea2c69 100644
--- a/Documentation/driver-model/devres.txt
+++ b/Documentation/driver-model/devres.txt
@@ -274,6 +274,8 @@ DMA
PCI
pcim_enable_device() : after success, all PCI ops become managed
pcim_pin_device() : keep PCI device enabled after release
+ pcim_map_single()
+ pcim_unmap_single()
IOMAP
devm_ioport_map()
diff --git a/include/asm-generic/pci-dma-compat.h b/include/asm-generic/pci-dma-compat.h
index 1437b7d..444e598 100644
--- a/include/asm-generic/pci-dma-compat.h
+++ b/include/asm-generic/pci-dma-compat.h
@@ -113,4 +113,21 @@ static inline int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
}
#endif
+/*
+ * Managed DMA API
+ */
+
+static inline dma_addr_t
+pcim_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction)
+{
+ return dmam_map_single(hwdev == NULL ? NULL : &hwdev->dev, ptr, size, (enum dma_data_direction)direction);
+}
+
+static inline void
+pcim_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
+ size_t size, int direction)
+{
+ dmam_unmap_single(hwdev == NULL ? NULL : &hwdev->dev, dma_addr, size, (enum dma_data_direction)direction);
+}
+
#endif
--
1.7.2.3
prev parent reply other threads:[~2014-05-17 12:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-17 12:22 [PATCH 1/3] dma-mapping: Add devm_ interface for dma_map_single() Eli Billauer
2014-05-17 12:22 ` [PATCH 2/3] dma-mapping: Add devm_ interface for dma_map_single_attrs() Eli Billauer
2014-05-17 12:22 ` Eli Billauer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1400329345-15556-3-git-send-email-eli.billauer@gmail.com \
--to=eli.billauer@gmail.com \
--cc=bhelgaas@google.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).