aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuentin Lambert <lambert.quentin@gmail.com>2015-04-13 04:26:53 -0400
committerDavid S. Miller <davem@davemloft.net>2015-04-17 15:32:07 -0400
commitd681f1166919d6829083c069a83edcd59bfd5e34 (patch)
tree738cd7f84d0295af0109a040f5e2eed5888ae21e
parent54e514b91b95d6441c12a7955addfb9f9d2afc65 (diff)
ide: remove deprecated use of pci api
Replace occurences of the pci api by appropriate call to the dma api. A simplified version of the semantic patch that finds this problem is as follows: (http://coccinelle.lip6.fr) @deprecated@ idexpression id; position p; @@ ( pci_dma_supported@p ( id, ...) | pci_alloc_consistent@p ( id, ...) ) @bad1@ idexpression id; position deprecated.p; @@ ...when != &id->dev when != pci_get_drvdata ( id ) when != pci_enable_device ( id ) ( pci_dma_supported@p ( id, ...) | pci_alloc_consistent@p ( id, ...) ) @depends on !bad1@ idexpression id; expression direction; position deprecated.p; @@ ( - pci_dma_supported@p ( id, + dma_supported ( &id->dev, ... + , GFP_ATOMIC ) | - pci_alloc_consistent@p ( id, + dma_alloc_coherent ( &id->dev, ... + , GFP_ATOMIC ) ) Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/ide/cs5520.c2
-rw-r--r--drivers/ide/pmac.c5
-rw-r--r--drivers/ide/setup-pci.c2
-rw-r--r--drivers/ide/sgiioc4.c4
4 files changed, 6 insertions, 7 deletions
diff --git a/drivers/ide/cs5520.c b/drivers/ide/cs5520.c
index 6250aee30503..89a4ff100b7a 100644
--- a/drivers/ide/cs5520.c
+++ b/drivers/ide/cs5520.c
@@ -123,7 +123,7 @@ static int cs5520_init_one(struct pci_dev *dev, const struct pci_device_id *id)
123 return -ENODEV; 123 return -ENODEV;
124 } 124 }
125 pci_set_master(dev); 125 pci_set_master(dev);
126 if (pci_set_dma_mask(dev, DMA_BIT_MASK(32))) { 126 if (dma_set_mask(&dev->dev, DMA_BIT_MASK(32))) {
127 printk(KERN_WARNING "%s: No suitable DMA available.\n", 127 printk(KERN_WARNING "%s: No suitable DMA available.\n",
128 d->name); 128 d->name);
129 return -ENODEV; 129 return -ENODEV;
diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
index d24a3f8b49bc..96a345248224 100644
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -1689,10 +1689,9 @@ static int pmac_ide_init_dma(ide_hwif_t *hwif, const struct ide_port_info *d)
1689 * The +2 is +1 for the stop command and +1 to allow for 1689 * The +2 is +1 for the stop command and +1 to allow for
1690 * aligning the start address to a multiple of 16 bytes. 1690 * aligning the start address to a multiple of 16 bytes.
1691 */ 1691 */
1692 pmif->dma_table_cpu = pci_alloc_consistent( 1692 pmif->dma_table_cpu = dma_alloc_coherent(&dev->dev,
1693 dev,
1694 (MAX_DCMDS + 2) * sizeof(struct dbdma_cmd), 1693 (MAX_DCMDS + 2) * sizeof(struct dbdma_cmd),
1695 &hwif->dmatable_dma); 1694 &hwif->dmatable_dma, GFP_KERNEL);
1696 if (pmif->dma_table_cpu == NULL) { 1695 if (pmif->dma_table_cpu == NULL) {
1697 printk(KERN_ERR "%s: unable to allocate DMA command list\n", 1696 printk(KERN_ERR "%s: unable to allocate DMA command list\n",
1698 hwif->name); 1697 hwif->name);
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index 34a5e5223d50..112d2fe1bcdb 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -209,7 +209,7 @@ static int ide_pci_enable(struct pci_dev *dev, const struct ide_port_info *d)
209 * a DMA mask field to the struct ide_port_info if we need it 209 * a DMA mask field to the struct ide_port_info if we need it
210 * (or let lower level driver set the DMA mask) 210 * (or let lower level driver set the DMA mask)
211 */ 211 */
212 ret = pci_set_dma_mask(dev, DMA_BIT_MASK(32)); 212 ret = dma_set_mask(&dev->dev, DMA_BIT_MASK(32));
213 if (ret < 0) { 213 if (ret < 0) {
214 printk(KERN_ERR "%s %s: can't set DMA mask\n", 214 printk(KERN_ERR "%s %s: can't set DMA mask\n",
215 d->name, pci_name(dev)); 215 d->name, pci_name(dev));
diff --git a/drivers/ide/sgiioc4.c b/drivers/ide/sgiioc4.c
index 63761db61384..2d35e9f7516f 100644
--- a/drivers/ide/sgiioc4.c
+++ b/drivers/ide/sgiioc4.c
@@ -334,8 +334,8 @@ static int ide_dma_sgiioc4(ide_hwif_t *hwif, const struct ide_port_info *d)
334 if (ide_allocate_dma_engine(hwif)) 334 if (ide_allocate_dma_engine(hwif))
335 goto dma_pci_alloc_failure; 335 goto dma_pci_alloc_failure;
336 336
337 pad = pci_alloc_consistent(dev, IOC4_IDE_CACHELINE_SIZE, 337 pad = dma_alloc_coherent(&dev->dev, IOC4_IDE_CACHELINE_SIZE,
338 (dma_addr_t *)&hwif->extra_base); 338 (dma_addr_t *)&hwif->extra_base, GFP_KERNEL);
339 if (pad) { 339 if (pad) {
340 ide_set_hwifdata(hwif, pad); 340 ide_set_hwifdata(hwif, pad);
341 return 0; 341 return 0;