On Thu, 10 Mar 2005, Nick Sillik wrote:

> +struct usb_onetouch {
> +     char name[128];
> +     char phys[64];
> +     struct input_dev dev;           /* input device interface */
> +     struct usb_device *udev;        /* usb device */
> +
> +     struct urb *irq;                /* urb for interrupt in report */
> +     unsigned char *data;            /* input data */
> +     dma_addr_t data_dma;
> +
> +     int open_count;                 /* reference count */
> +};
> +
> +struct usb_onetouch_wrap {
> +     struct list_head list;
> +     struct usb_onetouch *onetouch;
> +};

What's wrong with putting the list_head directly into struct usb_onetouch?  
Then you only have to allocate one structure, not two.

> +static void onetouch_close(struct input_dev *dev)
> +{
> +     struct usb_onetouch *onetouch = dev->private;
> +
> +     if (!--onetouch->open_count)
> +             usb_unlink_urb(onetouch->irq);
> +}

You should call usb_kill_urb here, not usb_unlink_urb.

Alan Stern



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to