Am Samstag, 25. Oktober 2003 20:08 schrieb John Wright:
> Here is the Magtek Swipe Card Reader device driver. I need a minor
> number.
>
> Thanks
>
> John Wright
> [EMAIL PROTECTED]
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
> http://shopping.yahoo.com
+ /* notify any processes */
+ if(urb->actual_length < priv->packet_size) {
+ priv->report_flag=1;
+ wake_up_interruptible(&queue);
+ }
a) are you sure you don't want <= instead of <
b) the interrupt handler will not work with real errors
+ /* unlock the minor table */
+ up (&minor_table_mutex);
+
+ /* lock this device */
+ spin_lock(&dev->lock);
race with disconnect, please reverse the order
+ spin_unlock_irqrestore(&dev->lock,flags);
+
+ /* copy data to userspace */
+ if (copy_to_user (buffer, dev->beta_buffer, (unsigned long)size))
+ {
+ spin_unlock_irqrestore(&dev->lock,flags);
+ return -EFAULT;
+ }
unlocking twice is a bad idea
+ /* zero the data structure (note: dev->data is set to zero here) */
+ memset(dev,0,sizeof(struct usb_magtek));
+
+ interface = &udev->actconfig->interface[ifnum];
+
You need to init the spinlock in that structure, or you will deadlock on
some architectures, eg ia64-smp
HTH
Oliver
-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community? Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel