From 412b979ccceff448dccea54bdb616c85781bc0ba Mon Sep 17 00:00:00 2001 From: Quentin Lambert Date: Wed, 15 Apr 2015 16:10:17 +0200 Subject: ALSA: 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 Signed-off-by: Takashi Iwai --- sound/pci/sis7019.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sound/pci/sis7019.c') diff --git a/sound/pci/sis7019.c b/sound/pci/sis7019.c index efe669b80256..f3860b850210 100644 --- a/sound/pci/sis7019.c +++ b/sound/pci/sis7019.c @@ -383,9 +383,9 @@ static void __sis_map_silence(struct sis7019 *sis) { /* Helper function: must hold sis->voice_lock on entry */ if (!sis->silence_users) - sis->silence_dma_addr = pci_map_single(sis->pci, + sis->silence_dma_addr = dma_map_single(&sis->pci->dev, sis->suspend_state[0], - 4096, PCI_DMA_TODEVICE); + 4096, DMA_TO_DEVICE); sis->silence_users++; } @@ -394,8 +394,8 @@ static void __sis_unmap_silence(struct sis7019 *sis) /* Helper function: must hold sis->voice_lock on entry */ sis->silence_users--; if (!sis->silence_users) - pci_unmap_single(sis->pci, sis->silence_dma_addr, 4096, - PCI_DMA_TODEVICE); + dma_unmap_single(&sis->pci->dev, sis->silence_dma_addr, 4096, + DMA_TO_DEVICE); } static void sis_free_voice(struct sis7019 *sis, struct voice *voice) @@ -1325,7 +1325,7 @@ static int sis_chip_create(struct snd_card *card, if (rc) goto error_out; - rc = pci_set_dma_mask(pci, DMA_BIT_MASK(30)); + rc = dma_set_mask(&pci->dev, DMA_BIT_MASK(30)); if (rc < 0) { dev_err(&pci->dev, "architecture does not support 30-bit PCI busmaster DMA"); goto error_out_enabled; -- cgit v1.2.3