On Tue, 10 Aug 2004 16:24:45 +0200 (CEST) Florian Echtler <[EMAIL PROTECTED]> wrote:
> +++ linux/drivers/usb/Makefile 2004-07-30 14:12:48.000000000 +0200 > +obj-$(CONFIG_USB_PHIDGETSERVO) += misc/ > obj-$(CONFIG_USB_RIO500) += misc/ > obj-$(CONFIG_USB_SPEEDTOUCH) += misc/ > obj-$(CONFIG_USB_TEST) += misc/ > obj-$(CONFIG_USB_TIGL) += misc/ > obj-$(CONFIG_USB_USS720) += misc/ > -obj-$(CONFIG_USB_PHIDGETSERVO) += misc/ What is this supposed to mean? > +++ linux/drivers/usb/misc/Kconfig 2004-07-30 13:50:09.000000000 +0200 > +MODULE_DEVICE_TABLE(usb, idmouse_table); > + > + > + > +/* structure to hold all of our device specific stuff */ Please remove extra empty lines, they make patch less robust in the future. > + up(&dev->sem); > + up(&disconnect_sem); > + return 0; > +} Something is up with whitespacing here. > + // lock this object > + down (&dev->sem); > + // unlock the device > + up(&dev->sem); Useless comments, remove them. // assign b to a a = b; > + /* are we really open? */ > + if (dev->open <= 0) { > + up(&dev->sem); > + up(&disconnect_sem); > + return -ENODEV; > + } > + > + --dev->open; > + > + if (!dev->present) { > + /* the device was unplugged before the file was released */ > + up(&dev->sem); > + idmouse_delete(dev); > + up(&disconnect_sem); > + return 0; > + } OK. This is not strictly speaking incorrect, BECAUSE you allow exclusive opens only. But in case that restriction is lifted, you only delete once close counts to zero. Why don't you simply copy the open+present scheme from 2.4 printer.c? (It is still pending in 2.6, unfortunately) > + // let the user know what node this device is now attached to > + info("%s connected to USB minor %d", DRIVER_DESC, dev->minor); This is not well thought out. Firstly, dmesg can scroll away. The /var/log/messages might not be readable, or missing. It's not a show-stopper, but something you might wish to change. How about adding an identification ioctl? -- Pete ------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel