diff options
author | David Brownell <david-b@pacbell.net> | 2007-05-08 03:25:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 14:15:00 -0400 |
commit | 2e17c5508fa015f2c7690e29041f437e9308c64f (patch) | |
tree | d53402b77180827931fc31b190be53c6b20ec2c0 /drivers/pnp/core.c | |
parent | 6f8bc500a10ab9cb3861e5bb71155d7bd2bbd2d5 (diff) |
init dma masks in pnp_dev
PNP now initializes device dma masks, which prevents oopses when generic
dma calls are made using pnp device nodes.
This assumes PNP only uses ISA DMA, with 24 bit addresses; and that it's
safe to init those masks for all devices (rather than finding out which
devices have been assigned DMA channels, and handling only those).
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Adam Belay <abelay@novell.com>
Cc: Jaroslav Kysela <perex@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/pnp/core.c')
-rw-r--r-- | drivers/pnp/core.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/pnp/core.c b/drivers/pnp/core.c index aec83ec5ea23..d8d75541552c 100644 --- a/drivers/pnp/core.c +++ b/drivers/pnp/core.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/string.h> | 14 | #include <linux/string.h> |
15 | #include <linux/slab.h> | 15 | #include <linux/slab.h> |
16 | #include <linux/errno.h> | 16 | #include <linux/errno.h> |
17 | #include <linux/dma-mapping.h> | ||
17 | 18 | ||
18 | #include "base.h" | 19 | #include "base.h" |
19 | 20 | ||
@@ -114,6 +115,8 @@ int __pnp_add_device(struct pnp_dev *dev) | |||
114 | int ret; | 115 | int ret; |
115 | pnp_fixup_device(dev); | 116 | pnp_fixup_device(dev); |
116 | dev->dev.bus = &pnp_bus_type; | 117 | dev->dev.bus = &pnp_bus_type; |
118 | dev->dev.dma_mask = &dev->dma_mask; | ||
119 | dev->dma_mask = dev->dev.coherent_dma_mask = DMA_24BIT_MASK; | ||
117 | dev->dev.release = &pnp_release_device; | 120 | dev->dev.release = &pnp_release_device; |
118 | dev->status = PNP_READY; | 121 | dev->status = PNP_READY; |
119 | spin_lock(&pnp_lock); | 122 | spin_lock(&pnp_lock); |