Re: Topro 6800 webcam driver

Alexey Klimov
2009-04-07T12:39:20Z

On Tue, 2009-04-07 at 15:13 +0400, Andrey Panin wrote:
> On 097, 04 07, 2009 at 11:41:32AM +0200, Anders Blomdell wrote:

<snip>

> > +static const struct sd_desc sd_desc = {
> > + .name = MODULE_NAME,
> > + .ctrls = sd_ctrls,
> > + .nctrls = ARRAY_SIZE(sd_ctrls),
> > + .config = sd_config,
> > + .init = sd_init,
> > + .start = sd_start,
> > + .stopN = sd_stopN,
> > + .pkt_scan = sd_pkt_scan,
> > + .querymenu = sd_querymenu,
> > +
> > +};
> > +
> > +static const __devinitdata struct usb_device_id device_table[] = {
> > + {USB_DEVICE(0x06a2, 0x0003)},
> > + {} /* Terminating entry */
> > +};
> > +
> > +MODULE_DEVICE_TABLE(usb, device_table);
> > +
> > +static int sd_probe(struct usb_interface *interface,
> > + const struct usb_device_id *id)
> > +{
> > + return gspca_dev_probe(interface, id, &sd_desc, sizeof(struct sd),
> > + THIS_MODULE);
> > +}
> > +
> > +static struct usb_driver tp6800_driver = {
> > + .name = MODULE_NAME,
> > + .id_table = device_table,
> > + .probe = sd_probe,
> > + .disconnect = gspca_disconnect,
> > +#ifdef CONFIG_PM
> > + .suspend = gspca_suspend,
> > + .resume = gspca_resume,
> > +#endif
> > +};
> > +
> > +/* Module loading and unloading */
> > +
> > +static int __init tp6800_init(void)
> > +{
> > + int result;
> > +
> > + result = usb_register(&tp6800_driver);
> > + if (result) {
> > + printk(KERN_INFO "%s usb_register_failed %d\n",
> > + MODULE_NAME, result);
> > + } else {
> > + printk(KERN_INFO "%s registered\n", MODULE_NAME);
> > + }
> > +
> > + return result;
> > +}
> > +
> > +static void __exit tp6800_exit(void)
> > +{
> > + usb_deregister(&tp6800_driver);
> > + printk(KERN_INFO "%s deregistered\n", MODULE_NAME);
> > +}
>
> Are these registered/deregistered messages really useful ?

Looks like that gspca-framework use PDEBUG() messages for that.
For example, t613.c contains this:

static void __exit sd_mod_exit(void)
{
usb_deregister(&sd_driver);
PDEBUG(D_PROBE, "deregistered");
}

--
Best regards, Klimov Alexey