mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/6] include, sound: pci_find_device remove
@ 2005-09-02 21:22 Jiri Slaby
  2005-09-02 21:44 ` [PATCH 6/6] include, sound: pci_find_device remove (s/pci/via82xx.c) Jiri Slaby
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Jiri Slaby @ 2005-09-02 21:22 UTC (permalink / raw)
  To: Greg KH; +Cc: Linux Kernel Mailing List, linux-pci

Set of patches, which removes pci_find_device from include and sound subtree.

 include/asm-i386/ide.h        |    7 ++++++-
 include/sound/cs46xx.h        |    1 -
 sound/core/memalloc.c         |   10 +++++-----
 sound/pci/ali5451/ali5451.c   |   16 +++++++++-------
 sound/pci/au88x0/au88x0.c     |   26 ++++++++++++++++----------
 sound/pci/cs46xx/cs46xx_lib.c |   13 +++++++++----
 sound/pci/via82xx.c           |    3 ++-

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 6/6] include, sound: pci_find_device remove (s/pci/via82xx.c)
  2005-09-02 21:22 [PATCH 0/6] include, sound: pci_find_device remove Jiri Slaby
@ 2005-09-02 21:44 ` Jiri Slaby
  2005-09-07 13:29   ` [Alsa-devel] " Takashi Iwai
  2005-09-02 21:44 ` [PATCH 3/6] include, sound: pci_find_device remove (s/pci/ali5451/ali5451.c) Jiri Slaby
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 8+ messages in thread
From: Jiri Slaby @ 2005-09-02 21:44 UTC (permalink / raw)
  To: Greg KH; +Cc: Linux Kernel Mailing List, linux-pci, alsa-devel, perex



Generated in 2.6.13-mm1 kernel version.

Signed-off-by: Jiri Slaby <xslaby@fi.muni.cz>

 via82xx.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
--- a/sound/pci/via82xx.c
+++ b/sound/pci/via82xx.c
@@ -1933,11 +1933,12 @@ static int snd_via82xx_chip_init(via82xx
 		 * DXS channels don't work properly with VRA if MC97 is disabled.
 		 */
 		struct pci_dev *pci;
-		pci = pci_find_device(0x1106, 0x3068, NULL); /* MC97 */
+		pci = pci_get_device(0x1106, 0x3068, NULL); /* MC97 */
 		if (pci) {
 			unsigned char data;
 			pci_read_config_byte(pci, 0x44, &data);
 			pci_write_config_byte(pci, 0x44, data | 0x40);
+			pci_dev_put(pci);
 		}
 	}
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 3/6] include, sound: pci_find_device remove (s/pci/ali5451/ali5451.c)
  2005-09-02 21:22 [PATCH 0/6] include, sound: pci_find_device remove Jiri Slaby
  2005-09-02 21:44 ` [PATCH 6/6] include, sound: pci_find_device remove (s/pci/via82xx.c) Jiri Slaby
@ 2005-09-02 21:44 ` Jiri Slaby
  2005-09-02 21:44 ` [PATCH 5/6] include, sound: pci_find_device remove (s/pci/cs46xx/cs46xx_lib.c) Jiri Slaby
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Jiri Slaby @ 2005-09-02 21:44 UTC (permalink / raw)
  To: Greg KH; +Cc: Linux Kernel Mailing List, linux-pci, alsa-devel, perex



Generated in 2.6.13-mm1 kernel version.

Signed-off-by: Jiri Slaby <xslaby@fi.muni.cz>

 ali5451.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c
--- a/sound/pci/ali5451/ali5451.c
+++ b/sound/pci/ali5451/ali5451.c
@@ -326,13 +326,12 @@ static void ali_read_regs(ali_t *codec, 
 static void ali_read_cfg(unsigned int vendor, unsigned deviceid)
 {
 	unsigned int dwVal;
-	struct pci_dev *pci_dev = NULL;
+	struct pci_dev *pci_dev;
 	int i,j;
 
-
-        pci_dev = pci_find_device(vendor, deviceid, pci_dev);
-        if (pci_dev == NULL)
-                return ;
+	pci_dev = pci_get_device(vendor, deviceid, NULL);
+	if (pci_dev == NULL)
+		return ;
 
 	printk("\nM%x PCI CFG\n", deviceid);
 	printk("    ");
@@ -349,6 +348,7 @@ static void ali_read_cfg(unsigned int ve
 		}
 		printk("\n");
 	}
+	pci_dev_put(pci_dev);
  }
 static void ali_read_ac97regs(ali_t *codec, int secondary)
 {
@@ -2112,6 +2112,8 @@ static int snd_ali_free(ali_t * codec)
 #ifdef CONFIG_PM
 	kfree(codec->image);
 #endif
+	pci_dev_put(codec->pci_m1533);
+	pci_dev_put(codec->pci_m7101);
 	kfree(codec);
 	return 0;
 }
@@ -2301,7 +2303,7 @@ static int __devinit snd_ali_create(snd_
 	codec->chregs.data.ainten = 0x00;
 
 	/* M1533: southbridge */
-       	pci_dev = pci_find_device(0x10b9, 0x1533, NULL);
+	pci_dev = pci_get_device(0x10b9, 0x1533, NULL);
 	codec->pci_m1533 = pci_dev;
 	if (! codec->pci_m1533) {
 		snd_printk(KERN_ERR "ali5451: cannot find ALi 1533 chip.\n");
@@ -2309,7 +2311,7 @@ static int __devinit snd_ali_create(snd_
 		return -ENODEV;
 	}
 	/* M7101: power management */
-       	pci_dev = pci_find_device(0x10b9, 0x7101, NULL);
+	pci_dev = pci_get_device(0x10b9, 0x7101, NULL);
 	codec->pci_m7101 = pci_dev;
 	if (! codec->pci_m7101 && codec->revision == ALI_5451_V02) {
 		snd_printk(KERN_ERR "ali5451: cannot find ALi 7101 chip.\n");

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 5/6] include, sound: pci_find_device remove (s/pci/cs46xx/cs46xx_lib.c)
  2005-09-02 21:22 [PATCH 0/6] include, sound: pci_find_device remove Jiri Slaby
  2005-09-02 21:44 ` [PATCH 6/6] include, sound: pci_find_device remove (s/pci/via82xx.c) Jiri Slaby
  2005-09-02 21:44 ` [PATCH 3/6] include, sound: pci_find_device remove (s/pci/ali5451/ali5451.c) Jiri Slaby
@ 2005-09-02 21:44 ` Jiri Slaby
  2005-09-02 21:44 ` [PATCH 4/6] include, sound: pci_find_device remove (s/pci/au88x0/au88x0.c) Jiri Slaby
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Jiri Slaby @ 2005-09-02 21:44 UTC (permalink / raw)
  To: Greg KH; +Cc: Linux Kernel Mailing List, linux-pci, alsa-devel, perex



Generated in 2.6.13-mm1 kernel version.

Signed-off-by: Jiri Slaby <xslaby@fi.muni.cz>

 include/sound/cs46xx.h        |    1 -
 sound/pci/cs46xx/cs46xx_lib.c |   13 +++++++++----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/include/sound/cs46xx.h b/include/sound/cs46xx.h
--- a/include/sound/cs46xx.h
+++ b/include/sound/cs46xx.h
@@ -1715,7 +1715,6 @@ struct _snd_cs46xx {
 	void (*active_ctrl)(cs46xx_t *, int);
   	void (*mixer_init)(cs46xx_t *);
 
-	struct pci_dev *acpi_dev;
 	int acpi_port;
 	snd_kcontrol_t *eapd_switch; /* for amplifier hack */
 	int accept_valid;	/* accept mmap valid (for OSS) */
diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c
--- a/sound/pci/cs46xx/cs46xx_lib.c
+++ b/sound/pci/cs46xx/cs46xx_lib.c
@@ -3548,7 +3548,7 @@ static void clkrun_hack(cs46xx_t *chip, 
 {
 	u16 control, nval;
 	
-	if (chip->acpi_dev == NULL)
+	if (!chip->acpi_port)
 		return;
 
 	chip->amplifier += change;
@@ -3571,15 +3571,20 @@ static void clkrun_hack(cs46xx_t *chip, 
  */
 static void clkrun_init(cs46xx_t *chip)
 {
+	struct pci_dev *pdev;
 	u8 pp;
 
-	chip->acpi_dev = pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, NULL);
-	if (chip->acpi_dev == NULL)
+	chip->acpi_port = 0;
+	
+	pdev = pci_get_device(PCI_VENDOR_ID_INTEL,
+		PCI_DEVICE_ID_INTEL_82371AB_3, NULL);
+	if (pdev == NULL)
 		return;		/* Not a thinkpad thats for sure */
 
 	/* Find the control port */		
-	pci_read_config_byte(chip->acpi_dev, 0x41, &pp);
+	pci_read_config_byte(pdev, 0x41, &pp);
 	chip->acpi_port = pp << 8;
+	pci_dev_put(pdev);
 }
 
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 4/6] include, sound: pci_find_device remove (s/pci/au88x0/au88x0.c)
  2005-09-02 21:22 [PATCH 0/6] include, sound: pci_find_device remove Jiri Slaby
                   ` (2 preceding siblings ...)
  2005-09-02 21:44 ` [PATCH 5/6] include, sound: pci_find_device remove (s/pci/cs46xx/cs46xx_lib.c) Jiri Slaby
@ 2005-09-02 21:44 ` Jiri Slaby
  2005-09-02 21:44 ` [PATCH 2/6] include, sound: pci_find_device remove (s/core/memalloc.c) Jiri Slaby
  2005-09-02 21:45 ` [PATCH 1/6] include, sound: pci_find_device remove (include/asm-i386/ide.h) Jiri Slaby
  5 siblings, 0 replies; 8+ messages in thread
From: Jiri Slaby @ 2005-09-02 21:44 UTC (permalink / raw)
  To: Greg KH; +Cc: Linux Kernel Mailing List, linux-pci, alsa-devel, perex



Generated in 2.6.13-mm1 kernel version.

Signed-off-by: Jiri Slaby <xslaby@fi.muni.cz>

 au88x0.c |   26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/sound/pci/au88x0/au88x0.c b/sound/pci/au88x0/au88x0.c
--- a/sound/pci/au88x0/au88x0.c
+++ b/sound/pci/au88x0/au88x0.c
@@ -79,19 +79,21 @@ static void vortex_fix_agp_bridge(struct
 
 static void __devinit snd_vortex_workaround(struct pci_dev *vortex, int fix)
 {
-	struct pci_dev *via;
+	struct pci_dev *via = NULL;
 
 	/* autodetect if workarounds are required */
 	if (fix == 255) {
 		/* VIA KT133 */
-		via = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8365_1, NULL);
+		via = pci_get_device(PCI_VENDOR_ID_VIA,
+			PCI_DEVICE_ID_VIA_8365_1, NULL);
 		/* VIA Apollo */
 		if (via == NULL) {
-			via = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C598_1, NULL);
-		}
-		/* AMD Irongate */
-		if (via == NULL) {
-			via = pci_find_device(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_FE_GATE_7007, NULL);
+			via = pci_get_device(PCI_VENDOR_ID_VIA,
+				PCI_DEVICE_ID_VIA_82C598_1, NULL);
+			/* AMD Irongate */
+			if (via == NULL)
+				via = pci_get_device(PCI_VENDOR_ID_AMD,
+					PCI_DEVICE_ID_AMD_FE_GATE_7007, NULL);
 		}
 		if (via) {
 			printk(KERN_INFO CARD_NAME ": Activating latency workaround...\n");
@@ -101,13 +103,17 @@ static void __devinit snd_vortex_workaro
 	} else {
 		if (fix & 0x1)
 			vortex_fix_latency(vortex);
-		if ((fix & 0x2) && (via = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8365_1, NULL)))
+		if ((fix & 0x2) && (via = pci_get_device(PCI_VENDOR_ID_VIA,
+				PCI_DEVICE_ID_VIA_8365_1, NULL)))
 			vortex_fix_agp_bridge(via);
-		if ((fix & 0x4) && (via = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C598_1, NULL)))
+		if ((fix & 0x4) && (via = pci_get_device(PCI_VENDOR_ID_VIA,
+				PCI_DEVICE_ID_VIA_82C598_1, NULL)))
 			vortex_fix_agp_bridge(via);
-		if ((fix & 0x8) && (via = pci_find_device(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_FE_GATE_7007, NULL)))
+		if ((fix & 0x8) && (via = pci_get_device(PCI_VENDOR_ID_AMD,
+				PCI_DEVICE_ID_AMD_FE_GATE_7007, NULL)))
 			vortex_fix_agp_bridge(via);
 	}
+	pci_dev_put(via);
 }
 
 // component-destructor

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 2/6] include, sound: pci_find_device remove (s/core/memalloc.c)
  2005-09-02 21:22 [PATCH 0/6] include, sound: pci_find_device remove Jiri Slaby
                   ` (3 preceding siblings ...)
  2005-09-02 21:44 ` [PATCH 4/6] include, sound: pci_find_device remove (s/pci/au88x0/au88x0.c) Jiri Slaby
@ 2005-09-02 21:44 ` Jiri Slaby
  2005-09-02 21:45 ` [PATCH 1/6] include, sound: pci_find_device remove (include/asm-i386/ide.h) Jiri Slaby
  5 siblings, 0 replies; 8+ messages in thread
From: Jiri Slaby @ 2005-09-02 21:44 UTC (permalink / raw)
  To: Greg KH; +Cc: Linux Kernel Mailing List, linux-pci, alsa-devel, perex



Generated in 2.6.13-mm1 kernel version.

Signed-off-by: Jiri Slaby <xslaby@fi.muni.cz>

 memalloc.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c
--- a/sound/core/memalloc.c
+++ b/sound/core/memalloc.c
@@ -567,8 +567,8 @@ static int snd_mem_proc_write(struct fil
 		char *endp;
 		int vendor, device, size, buffers;
 		long mask;
-		int i, alloced;
-		struct pci_dev *pci;
+		int i, alloced = 0;
+		struct pci_dev *pci = NULL;
 
 		if ((token = gettoken(&p)) == NULL ||
 		    (vendor = simple_strtol(token, NULL, 0)) <= 0 ||
@@ -588,13 +588,12 @@ static int snd_mem_proc_write(struct fil
 		vendor &= 0xffff;
 		device &= 0xffff;
 
-		alloced = 0;
-		pci = NULL;
-		while ((pci = pci_find_device(vendor, device, pci)) != NULL) {
+		while ((pci = pci_get_device(vendor, device, pci)) != NULL) {
 			if (mask > 0 && mask < 0xffffffff) {
 				if (pci_set_dma_mask(pci, mask) < 0 ||
 				    pci_set_consistent_dma_mask(pci, mask) < 0) {
 					printk(KERN_ERR "snd-page-alloc: cannot set DMA mask %lx for pci %04x:%04x\n", mask, vendor, device);
+					pci_dev_put(pci);
 					return (int)count;
 				}
 			}
@@ -604,6 +603,7 @@ static int snd_mem_proc_write(struct fil
 				if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci),
 							size, &dmab) < 0) {
 					printk(KERN_ERR "snd-page-alloc: cannot allocate buffer pages (size = %d)\n", size);
+					pci_dev_put(pci);
 					return (int)count;
 				}
 				snd_dma_reserve_buf(&dmab, snd_dma_pci_buf_id(pci));

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/6] include, sound: pci_find_device remove (include/asm-i386/ide.h)
  2005-09-02 21:22 [PATCH 0/6] include, sound: pci_find_device remove Jiri Slaby
                   ` (4 preceding siblings ...)
  2005-09-02 21:44 ` [PATCH 2/6] include, sound: pci_find_device remove (s/core/memalloc.c) Jiri Slaby
@ 2005-09-02 21:45 ` Jiri Slaby
  5 siblings, 0 replies; 8+ messages in thread
From: Jiri Slaby @ 2005-09-02 21:45 UTC (permalink / raw)
  To: Greg KH; +Cc: Linux Kernel Mailing List, linux-pci, linux-ide, B.Zolnierkiewicz

Generated in 2.6.13-mm1 kernel version.

Signed-off-by: Jiri Slaby <xslaby@fi.muni.cz>

 ide.h |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/asm-i386/ide.h b/include/asm-i386/ide.h
--- a/include/asm-i386/ide.h
+++ b/include/asm-i386/ide.h
@@ -41,7 +41,12 @@ static __inline__ int ide_default_irq(un
 
 static __inline__ unsigned long ide_default_io_base(int index)
 {
-	if (pci_find_device(PCI_ANY_ID, PCI_ANY_ID, NULL) == NULL) {
+	struct pci_dev *pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL);
+	unsigned int a = !pdev;
+
+	pci_dev_put(pdev);
+
+	if (a) {
 		switch(index) {
 			case 2: return 0x1e8;
 			case 3: return 0x168;

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Alsa-devel] [PATCH 6/6] include, sound: pci_find_device remove (s/pci/via82xx.c)
  2005-09-02 21:44 ` [PATCH 6/6] include, sound: pci_find_device remove (s/pci/via82xx.c) Jiri Slaby
@ 2005-09-07 13:29   ` Takashi Iwai
  0 siblings, 0 replies; 8+ messages in thread
From: Takashi Iwai @ 2005-09-07 13:29 UTC (permalink / raw)
  To: Jiri Slaby
  Cc: Greg KH, Linux Kernel Mailing List, linux-pci, alsa-devel, perex

At Fri, 2 Sep 2005 23:44:54 +0200,
Jiri Slaby wrote:
> 
> Generated in 2.6.13-mm1 kernel version.
> 
> Signed-off-by: Jiri Slaby <xslaby@fi.muni.cz>

Thanks, I took all sound/* patches to ALSA tree.


Takashi

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-09-07 13:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-02 21:22 [PATCH 0/6] include, sound: pci_find_device remove Jiri Slaby
2005-09-02 21:44 ` [PATCH 6/6] include, sound: pci_find_device remove (s/pci/via82xx.c) Jiri Slaby
2005-09-07 13:29   ` [Alsa-devel] " Takashi Iwai
2005-09-02 21:44 ` [PATCH 3/6] include, sound: pci_find_device remove (s/pci/ali5451/ali5451.c) Jiri Slaby
2005-09-02 21:44 ` [PATCH 5/6] include, sound: pci_find_device remove (s/pci/cs46xx/cs46xx_lib.c) Jiri Slaby
2005-09-02 21:44 ` [PATCH 4/6] include, sound: pci_find_device remove (s/pci/au88x0/au88x0.c) Jiri Slaby
2005-09-02 21:44 ` [PATCH 2/6] include, sound: pci_find_device remove (s/core/memalloc.c) Jiri Slaby
2005-09-02 21:45 ` [PATCH 1/6] include, sound: pci_find_device remove (include/asm-i386/ide.h) Jiri Slaby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®