From: Yang Hongyang <yanghy@cn.fujitsu.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Andrew Morton <akpm@linux-foundation.org>,
"David S. Miller" <davem@davemloft.net>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
Borislav Petkov <petkovbb@googlemail.com>
Subject: [PATCHv2 11/11]Update the old macro DMA_nBIT_MASK related documentations
Date: Thu, 19 Feb 2009 17:53:26 +0800 [thread overview]
Message-ID: <499D2C16.9050901@cn.fujitsu.com> (raw)
In-Reply-To: <499D2728.1080208@cn.fujitsu.com>
Update the old macro DMA_nBIT_MASK related documentations
Signed-off-by: Yang Hongyang<yanghy@cn.fujitsu.com>
---
Documentation/DMA-mapping.txt | 18 +++++++++---------
.../sound/alsa/DocBook/writing-an-alsa-driver.tmpl | 8 ++++----
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/Documentation/DMA-mapping.txt b/Documentation/DMA-mapping.txt
index b2a4d6d..01f24e9 100644
--- a/Documentation/DMA-mapping.txt
+++ b/Documentation/DMA-mapping.txt
@@ -136,7 +136,7 @@ exactly why.
The standard 32-bit addressing PCI device would do something like
this:
- if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
+ if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
printk(KERN_WARNING
"mydev: No suitable DMA available.\n");
goto ignore_this_device;
@@ -155,9 +155,9 @@ all 64-bits when accessing streaming DMA:
int using_dac;
- if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) {
+ if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
using_dac = 1;
- } else if (!pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
+ } else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
using_dac = 0;
} else {
printk(KERN_WARNING
@@ -170,14 +170,14 @@ the case would look like this:
int using_dac, consistent_using_dac;
- if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) {
+ if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
using_dac = 1;
consistent_using_dac = 1;
- pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK);
- } else if (!pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
+ pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
+ } else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
using_dac = 0;
consistent_using_dac = 0;
- pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
+ pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
} else {
printk(KERN_WARNING
"mydev: No suitable DMA available.\n");
@@ -192,7 +192,7 @@ check the return value from pci_set_consistent_dma_mask().
Finally, if your device can only drive the low 24-bits of
address during PCI bus mastering you might do something like:
- if (pci_set_dma_mask(pdev, DMA_24BIT_MASK)) {
+ if (pci_set_dma_mask(pdev, DMA_BIT_MASK(24))) {
printk(KERN_WARNING
"mydev: 24-bit DMA addressing not available.\n");
goto ignore_this_device;
@@ -213,7 +213,7 @@ most specific mask.
Here is pseudo-code showing how this might be done:
- #define PLAYBACK_ADDRESS_BITS DMA_32BIT_MASK
+ #define PLAYBACK_ADDRESS_BITS DMA_BIT_MASK(32)
#define RECORD_ADDRESS_BITS 0x00ffffff
struct my_sound_card *card;
diff --git a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
index 87a7c07..282891c 100644
--- a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
+++ b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
@@ -1133,8 +1133,8 @@
if (err < 0)
return err;
/* check PCI availability (28bit DMA) */
- if (pci_set_dma_mask(pci, DMA_28BIT_MASK) < 0 ||
- pci_set_consistent_dma_mask(pci, DMA_28BIT_MASK) < 0) {
+ if (pci_set_dma_mask(pci, DMA_BIT_MASK(28)) < 0 ||
+ pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(28)) < 0) {
printk(KERN_ERR "error to set 28bit mask DMA\n");
pci_disable_device(pci);
return -ENXIO;
@@ -1248,8 +1248,8 @@
err = pci_enable_device(pci);
if (err < 0)
return err;
- if (pci_set_dma_mask(pci, DMA_28BIT_MASK) < 0 ||
- pci_set_consistent_dma_mask(pci, DMA_28BIT_MASK) < 0) {
+ if (pci_set_dma_mask(pci, DMA_BIT_MASK(28)) < 0 ||
+ pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(28)) < 0) {
printk(KERN_ERR "error to set 28bit mask DMA\n");
pci_disable_device(pci);
return -ENXIO;
--
1.6.0.3
--
Regards
Yang Hongyang
next prev parent reply other threads:[~2009-02-19 9:52 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-19 6:35 [PATCH 00/12]Next:Get rid of all the old micro DMA_XXBIT_MASK and use DMA_BIT_MASK(n) instead Yang Hongyang
2009-02-19 6:38 ` [PATCH 01/12]Replace all DMA_64BIT_MASK micro with DMA_BIT_MASK(64) Yang Hongyang
2009-02-19 6:40 ` [PATCH 02/12]Replace all DMA_48BIT_MASK micro with DMA_BIT_MASK(48) Yang Hongyang
2009-02-19 6:41 ` [PATCH 03/12]Replace all DMA_40BIT_MASK micro with DMA_BIT_MASK(40) Yang Hongyang
2009-02-19 6:44 ` [PATCH 04/12]Replace all DMA_39BIT_MASK micro with DMA_BIT_MASK(39) Yang Hongyang
2009-02-19 6:45 ` [PATCH 05/12]Replace all DMA_35BIT_MASK micro with DMA_BIT_MASK(35) Yang Hongyang
2009-02-19 6:46 ` [PATCH 06/12]Replace all DMA_32BIT_MASK micro with DMA_BIT_MASK(32) Yang Hongyang
2009-02-19 6:48 ` [PATCH 07/12]Replace all DMA_31BIT_MASK micro with DMA_BIT_MASK(31) Yang Hongyang
2009-02-19 6:49 ` [PATCH 00/12]Next:Get rid of all the old micro DMA_XXBIT_MASK and use DMA_BIT_MASK(n) instead Américo Wang
2009-02-19 8:52 ` Yang Hongyang
2009-02-19 6:49 ` [PATCH 08/12]Replace all DMA_30BIT_MASK micro with DMA_BIT_MASK(30) Yang Hongyang
2009-02-19 6:51 ` [PATCH 09/12]Replace all DMA_28BIT_MASK micro with DMA_BIT_MASK(28) Yang Hongyang
2009-02-19 6:53 ` [PATCH 10/12]Replace all DMA_24BIT_MASK micro with DMA_BIT_MASK(24) Yang Hongyang
2009-02-19 6:54 ` [PATCH 11/12]Remove defines of DMA_XXBIT_MASK micro Yang Hongyang
2009-02-19 8:14 ` Ingo Molnar
2009-02-19 8:56 ` Yang Hongyang
2009-02-19 9:32 ` [PATCHv2 00/11]Get rid of all the old macro DMA_nBIT_MASK and use DMA_BIT_MASK(n) instead Yang Hongyang
2009-02-19 9:36 ` [PATCHv2 01/11]Replace all DMA_64BIT_MASK macro with DMA_BIT_MASK(64) Yang Hongyang
2009-02-19 9:38 ` [PATCHv2 02/11]Replace all DMA_48BIT_MASK macro with DMA_BIT_MASK(48) Yang Hongyang
2009-02-19 9:40 ` [PATCHv2 03/11]Replace all DMA_40BIT_MASK macro with DMA_BIT_MASK(40) Yang Hongyang
2009-02-19 9:42 ` [PATCHv2 04/11]Replace all DMA_39BIT_MASK macro with DMA_BIT_MASK(39) Yang Hongyang
2009-02-19 9:43 ` [PATCHv2 05/11]Replace all DMA_35BIT_MASK macro with DMA_BIT_MASK(35) Yang Hongyang
2009-02-19 9:45 ` [PATCHv2 06/11]Replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) Yang Hongyang
2009-02-19 12:50 ` Stefan Richter
2009-02-19 9:47 ` [PATCHv2 07/11]Replace all DMA_31BIT_MASK macro with DMA_BIT_MASK(31) Yang Hongyang
2009-02-19 9:48 ` [PATCHv2 08/11]Replace all DMA_30BIT_MASK macro with DMA_BIT_MASK(30) Yang Hongyang
2009-02-19 9:50 ` [PATCHv2 09/11]Replace all DMA_28BIT_MASK macro with DMA_BIT_MASK(28) Yang Hongyang
2009-02-19 9:51 ` [PATCHv2 10/11]Replace all DMA_24BIT_MASK macro with DMA_BIT_MASK(24) Yang Hongyang
2009-02-19 9:53 ` Yang Hongyang [this message]
2009-02-19 12:47 ` [PATCHv2 00/11]Get rid of all the old macro DMA_nBIT_MASK and use DMA_BIT_MASK(n) instead Stefan Richter
2009-02-19 15:08 ` Ingo Molnar
2009-02-19 23:14 ` Andrew Morton
2009-02-20 10:29 ` Ingo Molnar
2009-02-19 6:55 ` [PATCH 12/12]Update related documentations Yang Hongyang
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=499D2C16.9050901@cn.fujitsu.com \
--to=yanghy@cn.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=netdev@vger.kernel.org \
--cc=petkovbb@googlemail.com \
/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).