diff options
author | Bryan O'Sullivan <bos@pathscale.com> | 2006-07-01 07:36:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-01 12:56:00 -0400 |
commit | 06993ca6bc46419027b45198a58447f4f05c14f6 (patch) | |
tree | de446bbc024a0710e2009e7310dce30d138e93ed /drivers/infiniband/hw/ipath/ipath_driver.c | |
parent | 0ed9a4a0b6df0548f9ccadb62add2c0155d5262c (diff) |
[PATCH] IB/ipath: use vmalloc to allocate struct ipath_devdata
This is not a DMA target, so no need to use dma_alloc_coherent on it.
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Cc: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_driver.c')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_driver.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_driver.c b/drivers/infiniband/hw/ipath/ipath_driver.c index 8fad35740fdb..c92f8e0a117a 100644 --- a/drivers/infiniband/hw/ipath/ipath_driver.c +++ b/drivers/infiniband/hw/ipath/ipath_driver.c | |||
@@ -171,14 +171,13 @@ static void ipath_free_devdata(struct pci_dev *pdev, | |||
171 | list_del(&dd->ipath_list); | 171 | list_del(&dd->ipath_list); |
172 | spin_unlock_irqrestore(&ipath_devs_lock, flags); | 172 | spin_unlock_irqrestore(&ipath_devs_lock, flags); |
173 | } | 173 | } |
174 | dma_free_coherent(&pdev->dev, sizeof(*dd), dd, dd->ipath_dma_addr); | 174 | vfree(dd); |
175 | } | 175 | } |
176 | 176 | ||
177 | static struct ipath_devdata *ipath_alloc_devdata(struct pci_dev *pdev) | 177 | static struct ipath_devdata *ipath_alloc_devdata(struct pci_dev *pdev) |
178 | { | 178 | { |
179 | unsigned long flags; | 179 | unsigned long flags; |
180 | struct ipath_devdata *dd; | 180 | struct ipath_devdata *dd; |
181 | dma_addr_t dma_addr; | ||
182 | int ret; | 181 | int ret; |
183 | 182 | ||
184 | if (!idr_pre_get(&unit_table, GFP_KERNEL)) { | 183 | if (!idr_pre_get(&unit_table, GFP_KERNEL)) { |
@@ -186,15 +185,12 @@ static struct ipath_devdata *ipath_alloc_devdata(struct pci_dev *pdev) | |||
186 | goto bail; | 185 | goto bail; |
187 | } | 186 | } |
188 | 187 | ||
189 | dd = dma_alloc_coherent(&pdev->dev, sizeof(*dd), &dma_addr, | 188 | dd = vmalloc(sizeof(*dd)); |
190 | GFP_KERNEL); | ||
191 | |||
192 | if (!dd) { | 189 | if (!dd) { |
193 | dd = ERR_PTR(-ENOMEM); | 190 | dd = ERR_PTR(-ENOMEM); |
194 | goto bail; | 191 | goto bail; |
195 | } | 192 | } |
196 | 193 | memset(dd, 0, sizeof(*dd)); | |
197 | dd->ipath_dma_addr = dma_addr; | ||
198 | dd->ipath_unit = -1; | 194 | dd->ipath_unit = -1; |
199 | 195 | ||
200 | spin_lock_irqsave(&ipath_devs_lock, flags); | 196 | spin_lock_irqsave(&ipath_devs_lock, flags); |