pci: use pci_ioremap_bar() in sound/
Subsystems (3)
PATCH 1/1 pci: use pci_ioremap_bar() in sound/
Quoted 2 lines
From
6666b6edd4a0c496932ef1640b742cc72f9c57d8Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <[email protected]>
Date: Sun, 28 Sep 2008 16:20:09 -0700
Subject: [PATCH] pci: use pci_ioremap_bar() in sound/
Use the newly introduced pci_ioremap_bar() function in sound/. pci_ioremap_bar() just takes a pci device and a bar number, with the goal of making it really hard to get wrong, while also having a central place to stick sanity checks.
--- sound/pci/ad1889.c | 2 +- sound/pci/atiixp.c | 2 +- sound/pci/atiixp_modem.c | 2 +- sound/pci/au88x0/au88x0.c | 3 +-- sound/pci/bt87x.c | 3 +-- sound/pci/cs4281.c | 4 ++-- sound/pci/cs5530.c | 2 +- sound/pci/hda/hda_intel.c | 2 +- sound/pci/mixart/mixart.c | 3 +-- 9 files changed, 10 insertions(+), 13 deletions(-)
sound/pci/ad1889.c +1 -1
@@ -932,7 +932,7 @@ snd_ad1889_create(struct snd_card *card, goto free_and_ret; chip->bar =pci_resource_start (pci,0 ); - chip->iobase =ioremap_nocache (chip->bar,pci_resource_len (pci,0 )); + chip->iobase =pci_ioremap_bar (pci,0 );if (chip->iobase ==NULL ) { printk(KERN_ERR PFX "unable to reserve region.\n"); err = -EBUSY ;
sound/pci/atiixp.c +1 -1
@@ -1609,7 +1609,7 @@ static int __devinit snd_atiixp_create(struct snd_card *card,return err; } chip->addr =pci_resource_start (pci,0 ); - chip->remap_addr =ioremap_nocache (chip->addr,pci_resource_len (pci,0 )); + chip->remap_addr =pci_ioremap_bar (pci,0 );if (chip->remap_addr ==NULL ) {snd_printk (KERN_ERR "AC'97 space ioremap problem\n" );snd_atiixp_free (chip);
sound/pci/atiixp_modem.c +1 -1
@@ -1252,7 +1252,7 @@ static int __devinit snd_atiixp_create(struct snd_card *card,return err; } chip->addr =pci_resource_start (pci,0 ); - chip->remap_addr =ioremap_nocache (chip->addr,pci_resource_len (pci,0 )); + chip->remap_addr =pci_ioremap_bar (pci,0 );if (chip->remap_addr ==NULL ) {snd_printk (KERN_ERR "AC'97 space ioremap problem\n" );snd_atiixp_free (chip);
sound/pci/au88x0/au88x0.c +1 -2
@@ -180,8 +180,7 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)if ((err =pci_request_regions (pci,CARD_NAME_SHORT )) !=0 ) goto regions_out; - chip->mmio =ioremap_nocache (pci_resource_start (pci,0 ), -pci_resource_len (pci,0 )); + chip->mmio =pci_ioremap_bar (pci,0 );if (!chip->mmio) {printk (KERN_ERR "MMIO area remap failed.\n" ); err = -ENOMEM ;
sound/pci/bt87x.c +1 -2
@@ -749,8 +749,7 @@ static int __devinit snd_bt87x_create(struct snd_card *card,pci_disable_device (pci);return err; } - chip->mmio =ioremap_nocache (pci_resource_start (pci,0 ), -pci_resource_len (pci,0 )); + chip->mmio =pci_ioremap_bar (pci,0 );if (!chip->mmio) {snd_printk (KERN_ERR "cannot remap io memory\n" ); err = -ENOMEM ;
sound/pci/cs4281.c +2 -2
@@ -1382,8 +1382,8 @@ static int __devinit snd_cs4281_create(struct snd_card *card, chip->ba0_addr =pci_resource_start (pci,0 ); chip->ba1_addr =pci_resource_start (pci,1 ); - chip->ba0 =ioremap_nocache (chip->ba0_addr,pci_resource_len (pci,0 )); - chip->ba1 =ioremap_nocache (chip->ba1_addr,pci_resource_len (pci,1 )); + chip->ba0 =pci_ioremap_bar (pci,0 ); + chip->ba1 =pci_ioremap_bar (pci,1 );if (!chip->ba0 || !chip->ba1) {snd_cs4281_free (chip);return -ENOMEM ;
sound/pci/cs5530.c +1 -1
@@ -132,7 +132,7 @@ static int __devinit snd_cs5530_create(struct snd_card *card, } chip->pci_base =pci_resource_start (pci,0 ); - mem =ioremap_nocache (chip->pci_base,pci_resource_len (pci,0 )); + mem =pci_ioremap_bar (pci,0 );if (mem ==NULL ) {kfree (chip);pci_disable_device (pci);
sound/pci/hda/hda_intel.c +1 -1
@@ -2158,7 +2158,7 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci, } chip->addr =pci_resource_start (pci,0 ); - chip->remap_addr =ioremap_nocache (chip->addr,pci_resource_len (pci,0 )); + chip->remap_addr =pci_ioremap_bar (pci,0 );if (chip->remap_addr ==NULL ) { snd_printk(KERN_ERR SFX "ioremap error\n"); err = -ENXIO ;
sound/pci/mixart/mixart.c +1 -2
@@ -1314,8 +1314,7 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci, }for (i =0 ; i <2 ; i++) { mgr->mem[i].phys =pci_resource_start (pci, i); - mgr->mem[i].virt =ioremap_nocache (mgr->mem[i].phys, -pci_resource_len (pci, i)); + mgr->mem[i].virt =pci_ioremap_bar (pci, i);if (!mgr->mem[i].virt) {printk (KERN_ERR "unable to remap resource 0x%lx\n" , mgr->mem[i].phys);
Signature · 7 lines
1.5.5.1 -- Arjan van de Ven Intel Open Source Technology Centre For development, discussion and tips for power savings, visit http://www.lesswatts.org
Takashi Iwai
AppliedAt Mon, 20 Oct 2008 21:53:46 -0700,
Quoted 7 lines · Arjan van de Ven
From
6666b6edd4a0c496932ef1640b742cc72f9c57d8Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <[email protected]>
Date: Sun, 28 Sep 2008 16:20:09 -0700
Subject: [PATCH] pci: usepci_ioremap_bar()insound/
Quoted 7 lines
Use the newly introduced
pci_ioremap_bar()function insound/.pci_ioremap_bar()just takes a pci device and a bar number, with the goal of making it really hard to get wrong, while also having a central place to stick sanity checks.Signed-off-by Arjan van de Ven <[email protected]>
Thanks, applied now to sound git tree.
Takashi