public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6.9-rc2-mm4 bttv-driver.c][4/8] convert pci_find_device to pci_dev_present
@ 2004-09-29 20:55 Hanna Linder
  2004-09-29 21:03 ` Christoph Hellwig
  0 siblings, 1 reply; 8+ messages in thread
From: Hanna Linder @ 2004-09-29 20:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: kernel-janitors, greg, hannal, kraxel


As pci_find_device is going away need to replace it. This file did not use the dev returned
from pci_find_device so is replaceable by pci_dev_present. I was not able to test it
as I do not have the hardware.

Hanna Linder
IBM Linux Technology Center

Signed-off-by: Hanna Linder <hannal@us.ibm.com>

diff -Nrup linux-2.6.9-rc2-mm4cln/drivers/media/video/bttv-driver.c linux-2.6.9-rc2-mm4patch/drivers/media/video/bttv-driver.c
--- linux-2.6.9-rc2-mm4cln/drivers/media/video/bttv-driver.c	2004-09-28 14:58:35.000000000 -0700
+++ linux-2.6.9-rc2-mm4patch/drivers/media/video/bttv-driver.c	2004-09-29 13:08:59.369697520 -0700
@@ -4012,6 +4012,10 @@ static int bttv_init_module(void)
 {
 	int rc;
 	bttv_num = 0;
+	static struct pci_device_id cx2388x[] {
+		{ PCI_DEVICE(0x14f1, 0x8800) },
+		{ },
+	};
 
 	printk(KERN_INFO "bttv: driver version %d.%d.%d loaded\n",
 	       (BTTV_VERSION_CODE >> 16) & 0xff,
@@ -4036,7 +4040,7 @@ static int bttv_init_module(void)
 	rc = pci_module_init(&bttv_pci_driver);
 	if (-ENODEV == rc) {
 		/* plenty of people trying to use bttv for the cx2388x ... */
-		if (NULL != pci_find_device(0x14f1, 0x8800, NULL))
+		if (pci_dev_present(cx2388x))
 			printk("bttv doesn't support your Conexant 2388x card.\n");
 	}
 	return rc;


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

* Re: [PATCH 2.6.9-rc2-mm4 bttv-driver.c][4/8] convert pci_find_device to pci_dev_present
  2004-09-29 20:55 [PATCH 2.6.9-rc2-mm4 bttv-driver.c][4/8] convert pci_find_device to pci_dev_present Hanna Linder
@ 2004-09-29 21:03 ` Christoph Hellwig
  2004-09-29 21:11   ` Greg KH
  2004-09-29 22:23   ` Tonnerre
  0 siblings, 2 replies; 8+ messages in thread
From: Christoph Hellwig @ 2004-09-29 21:03 UTC (permalink / raw)
  To: Hanna Linder; +Cc: linux-kernel, kernel-janitors, greg, kraxel

On Wed, Sep 29, 2004 at 01:55:22PM -0700, Hanna Linder wrote:
> 
> As pci_find_device is going away need to replace it. This file did not use the dev returned
> from pci_find_device so is replaceable by pci_dev_present. I was not able to test it
> as I do not have the hardware.

I think this check should just go away completely.  

We don't have such silly warnings in any other driver.

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

* Re: [PATCH 2.6.9-rc2-mm4 bttv-driver.c][4/8] convert pci_find_device to pci_dev_present
  2004-09-29 21:03 ` Christoph Hellwig
@ 2004-09-29 21:11   ` Greg KH
  2004-09-29 21:43     ` Hanna Linder
  2004-09-29 22:23   ` Tonnerre
  1 sibling, 1 reply; 8+ messages in thread
From: Greg KH @ 2004-09-29 21:11 UTC (permalink / raw)
  To: Christoph Hellwig, Hanna Linder, linux-kernel, kernel-janitors,
	kraxel

On Wed, Sep 29, 2004 at 10:03:44PM +0100, Christoph Hellwig wrote:
> On Wed, Sep 29, 2004 at 01:55:22PM -0700, Hanna Linder wrote:
> > 
> > As pci_find_device is going away need to replace it. This file did not use the dev returned
> > from pci_find_device so is replaceable by pci_dev_present. I was not able to test it
> > as I do not have the hardware.
> 
> I think this check should just go away completely.  

Good point.  Especially as pci_module_init() can never return -ENODEV
anymore :)

Hanna, care to respin this patch?

thanks,

greg k-h

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

* Re: [PATCH 2.6.9-rc2-mm4 bttv-driver.c][4/8] convert pci_find_device to pci_dev_present
  2004-09-29 21:11   ` Greg KH
@ 2004-09-29 21:43     ` Hanna Linder
  2004-09-29 22:28       ` [Kernel-janitors] " Matthew Wilcox
  0 siblings, 1 reply; 8+ messages in thread
From: Hanna Linder @ 2004-09-29 21:43 UTC (permalink / raw)
  To: Greg KH, Christoph Hellwig, linux-kernel, kernel-janitors, kraxel
  Cc: Hanna Linder

--On Wednesday, September 29, 2004 02:11:35 PM -0700 Greg KH <greg@kroah.com> wrote:
> On Wed, Sep 29, 2004 at 10:03:44PM +0100, Christoph Hellwig wrote:
>> On Wed, Sep 29, 2004 at 01:55:22PM -0700, Hanna Linder wrote:
>> > 
>> > As pci_find_device is going away need to replace it. This file did not use the dev returned
>> > from pci_find_device so is replaceable by pci_dev_present. I was not able to test it
>> > as I do not have the hardware.
>> 
>> I think this check should just go away completely.  
> 
> Good point.  Especially as pci_module_init() can never return -ENODEV
> anymore :)
> 
> Hanna, care to respin this patch?

Here it is, compile tested this time...

Signed-off-by: Hanna Linder <hannal@us.ibm.com>

diff -Nrup linux-2.6.9-rc2-mm4cln/drivers/media/video/bttv-driver.c linux-2.6.9-rc2-mm4patch2/drivers/media/video/bttv-driver.c
--- linux-2.6.9-rc2-mm4cln/drivers/media/video/bttv-driver.c	2004-09-28 14:58:35.000000000 -0700
+++ linux-2.6.9-rc2-mm4patch2/drivers/media/video/bttv-driver.c	2004-09-29 14:30:38.000000000 -0700
@@ -4010,7 +4010,6 @@ static struct pci_driver bttv_pci_driver
 
 static int bttv_init_module(void)
 {
-	int rc;
 	bttv_num = 0;
 
 	printk(KERN_INFO "bttv: driver version %d.%d.%d loaded\n",
@@ -4033,13 +4032,7 @@ static int bttv_init_module(void)
 	bttv_check_chipset();
 
 	bus_register(&bttv_sub_bus_type);
-	rc = pci_module_init(&bttv_pci_driver);
-	if (-ENODEV == rc) {
-		/* plenty of people trying to use bttv for the cx2388x ... */
-		if (NULL != pci_find_device(0x14f1, 0x8800, NULL))
-			printk("bttv doesn't support your Conexant 2388x card.\n");
-	}
-	return rc;
+	return(pci_module_init(&bttv_pci_driver));
 }
 
 static void bttv_cleanup_module(void)



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

* Re: [PATCH 2.6.9-rc2-mm4 bttv-driver.c][4/8] convert pci_find_device to pci_dev_present
  2004-09-29 21:03 ` Christoph Hellwig
  2004-09-29 21:11   ` Greg KH
@ 2004-09-29 22:23   ` Tonnerre
  2004-09-30  8:23     ` Gerd Knorr
  1 sibling, 1 reply; 8+ messages in thread
From: Tonnerre @ 2004-09-29 22:23 UTC (permalink / raw)
  To: Christoph Hellwig, Hanna Linder, linux-kernel, kernel-janitors,
	greg, kraxel

[-- Attachment #1: Type: text/plain, Size: 496 bytes --]

Salut,

On Wed, Sep 29, 2004 at 10:03:44PM +0100, Christoph Hellwig wrote:
> I think this check should just go away completely.  
> 
> We don't have such silly warnings in any other driver.

Kraxel introduced this  check because of the confusion  with the "old"
and "new" WinTV cards. The older one had a bt848 chip, the newer one a
connexant 878, and only the older one was supported by Linux.

Now that we support both, this printk is rather counterproductive.

			    Tonnerre


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [Kernel-janitors] Re: [PATCH 2.6.9-rc2-mm4 bttv-driver.c][4/8] convert pci_find_device to pci_dev_present
  2004-09-29 21:43     ` Hanna Linder
@ 2004-09-29 22:28       ` Matthew Wilcox
  2004-09-29 22:32         ` Hanna Linder
  0 siblings, 1 reply; 8+ messages in thread
From: Matthew Wilcox @ 2004-09-29 22:28 UTC (permalink / raw)
  To: Hanna Linder
  Cc: Greg KH, Christoph Hellwig, linux-kernel, kernel-janitors, kraxel

On Wed, Sep 29, 2004 at 02:43:38PM -0700, Hanna Linder wrote:
> +	return(pci_module_init(&bttv_pci_driver));

Why the extra brackets?  I see their use for

	return (a == b);

but

	return pci_module_init(&bttv_pci_driver);

isn't at all ambiguous.

-- 
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain

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

* Re: [Kernel-janitors] Re: [PATCH 2.6.9-rc2-mm4 bttv-driver.c][4/8] convert pci_find_device to pci_dev_present
  2004-09-29 22:28       ` [Kernel-janitors] " Matthew Wilcox
@ 2004-09-29 22:32         ` Hanna Linder
  0 siblings, 0 replies; 8+ messages in thread
From: Hanna Linder @ 2004-09-29 22:32 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: Hanna Linder, Greg KH, Christoph Hellwig, linux-kernel,
	kernel-janitors, kraxel

--On Wednesday, September 29, 2004 11:28:25 PM +0100 Matthew Wilcox <matthew@wil.cx> wrote:

> On Wed, Sep 29, 2004 at 02:43:38PM -0700, Hanna Linder wrote:
>> +	return(pci_module_init(&bttv_pci_driver));
> 
> Why the extra brackets?  I see their use for

I was already corrected offline. Greg is going to fix this before he applies it.

Thanks.

Hanna


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

* Re: [PATCH 2.6.9-rc2-mm4 bttv-driver.c][4/8] convert pci_find_device to pci_dev_present
  2004-09-29 22:23   ` Tonnerre
@ 2004-09-30  8:23     ` Gerd Knorr
  0 siblings, 0 replies; 8+ messages in thread
From: Gerd Knorr @ 2004-09-30  8:23 UTC (permalink / raw)
  To: Tonnerre
  Cc: Christoph Hellwig, Hanna Linder, linux-kernel, kernel-janitors,
	greg

On Thu, Sep 30, 2004 at 12:23:53AM +0200, Tonnerre wrote:
> Salut,
> 
> On Wed, Sep 29, 2004 at 10:03:44PM +0100, Christoph Hellwig wrote:
> > I think this check should just go away completely.  
> > We don't have such silly warnings in any other driver.
> 
> Kraxel introduced this  check because of the confusion  with the "old"
> and "new" WinTV cards. The older one had a bt848 chip, the newer one a
> connexant 878, and only the older one was supported by Linux.

Yep, that was the reason.  It's pretty much obsolete these days through
as we have a working (well, sort of, depending on the tv norm sound may
be a problem ...) driver for these cards in mainline.  Just dropping
that now is perfectly fine.

  Gerd

-- 
return -ENOSIG;

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

end of thread, other threads:[~2004-09-30  8:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-29 20:55 [PATCH 2.6.9-rc2-mm4 bttv-driver.c][4/8] convert pci_find_device to pci_dev_present Hanna Linder
2004-09-29 21:03 ` Christoph Hellwig
2004-09-29 21:11   ` Greg KH
2004-09-29 21:43     ` Hanna Linder
2004-09-29 22:28       ` [Kernel-janitors] " Matthew Wilcox
2004-09-29 22:32         ` Hanna Linder
2004-09-29 22:23   ` Tonnerre
2004-09-30  8:23     ` Gerd Knorr

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