From: domen@coderock.org
To: jgarzik@pobox.com
Cc: netdev@oss.sgi.com, Tobias Klauser <tklauser@nuerscht.ch>,
domen@coderock.org
Subject: [patch 1/1] Use pci_set_dma_mask() instead of direct assignment of DMA mask
Date: Sun, 29 May 2005 01:16:55 +0200 [thread overview]
Message-ID: <20050528231654.365592000@nd47.coderock.org> (raw)
[-- Attachment #1: dma_mask-drivers_net_amd8111e --]
[-- Type: text/plain, Size: 1329 bytes --]
From: Tobias Klauser <tklauser@nuerscht.ch>
The amd8111e driver directly assigns the DMA mask to the dma_mask
member of the struct pci_dev instead of using pci_set_dma_mask(). This
makes the call to pci_dma_supported() redundant as pci_set_dma_mask()
does this check.
I do not own this device so I only compile-tested this patch.
Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch>
Signed-off-by: Domen Puncer <domen@coderock.org>
---
amd8111e.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
Index: quilt/drivers/net/amd8111e.c
===================================================================
--- quilt.orig/drivers/net/amd8111e.c
+++ quilt/drivers/net/amd8111e.c
@@ -87,6 +87,7 @@ Revision History:
#include <linux/if_vlan.h>
#include <linux/ctype.h>
#include <linux/crc32.h>
+#include <linux/dma-mapping.h>
#include <asm/system.h>
#include <asm/io.h>
@@ -2002,12 +2003,11 @@ static int __devinit amd8111e_probe_one(
}
/* Initialize DMA */
- if(!pci_dma_supported(pdev, 0xffffffff)){
+ if (pci_set_dma_mask(pdev, DMA_32BIT_MASK) < 0) {
printk(KERN_ERR "amd8111e: DMA not supported,"
"exiting.\n");
- goto err_free_reg;
- } else
- pdev->dma_mask = 0xffffffff;
+ goto err_free_reg;
+ }
reg_addr = pci_resource_start(pdev, 0);
reg_len = pci_resource_len(pdev, 0);
--
reply other threads:[~2005-05-28 23:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20050528231654.365592000@nd47.coderock.org \
--to=domen@coderock.org \
--cc=jgarzik@pobox.com \
--cc=netdev@oss.sgi.com \
--cc=tklauser@nuerscht.ch \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.