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 <[email protected]>
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;
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.
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
--On Wednesday, September 29, 2004 02:11:35 PM -0700 Greg KH <[email protected]> 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 <[email protected]>
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)
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
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
--On Wednesday, September 29, 2004 11:28:25 PM +0100 Matthew Wilcox <[email protected]> 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
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;