Re: zr36067 no longer loads automatically (regression)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 8 Jan 2009 13:20:19 -0800 (PST)
Trent Piepho <xyzzy@xxxxxxxxxxxxx> wrote:

> On Thu, 8 Jan 2009, Mauro Carvalho Chehab wrote:
> > > http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=60b4bde48b36c0315ef41fd38c339b9c7e68c46f
> > > causes the zr36067 driver to no longer load automatically on systems
> > > with a Zoran-based adapter. The comment says that zr36067_pci_tbl was
> > > unused but this isn't true when the zr36067 driver is built as a module
> > > (which is almost always the case.) zr36067_pci_tbl is used to generate
> > > the modprobe alias which lets udev load the zr36067 driver.
> > Hmm... I've forgot about udev. Anyway, just reverting it won't work fine, since, when compiled in-kernel, it generates warnings and adds a code that won't be used anywere.
> >
> > It seems that the proper fix is the enclosed patch. Could you test it please?
> 
> It doesn't seem like any other driver needs to protect the module device
> table with an ifdef.

The other drivers use the PCI table for probing the device, using this construction:

static struct pci_device_id bttv_pci_tbl[] = {
        {PCI_VENDOR_ID_BROOKTREE, PCI_DEVICE_ID_BT848, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
        {0,}
};

MODULE_DEVICE_TABLE(pci, bttv_pci_tbl);

static struct pci_driver bttv_pci_driver = {
        .name     = "bttv",
        .id_table = bttv_pci_tbl,
        .probe    = bttv_probe,
        .remove   = __devexit_p(bttv_remove),
};

static int __init bttv_init_module(void)
{
	...
	ret = pci_register_driver(&bttv_pci_driver);
	...
}

With this, the PCI bus will take a look at the PCI ID table run the .probe
callback if a board with the given PCI ID's is detected.

However, Zoran driver doesn't rely on pci_register_driver(). Instead, it uses a
while() loop to probe for Zoran devices:

static int __devinit
find_zr36057 (void)
{
	...

        zoran_num = 0;
        while (zoran_num < BUZ_MAX &&
               (dev = pci_get_device(PCI_VENDOR_ID_ZORAN, PCI_DEVICE_ID_ZORAN_36057, dev)) != NULL) {
	...
}



Cheers,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux