ChangeSet 1.1673.8.26, 2004/03/26 11:21:48-08:00, oliver@neukum.org [PATCH] USB: cleanup of st5481 you are using __devinit which must not be used with USB drivers, in addition you are using some false GFP values and fail to check some error codes. - check for unlink due to removal of controller - correct GFP values - no __devinit in USB drivers/isdn/hisax/st5481_b.c | 6 +++--- drivers/isdn/hisax/st5481_d.c | 8 ++++---- drivers/isdn/hisax/st5481_init.c | 4 ++-- drivers/isdn/hisax/st5481_usb.c | 24 ++++++++++++------------ 4 files changed, 21 insertions(+), 21 deletions(-) diff -Nru a/drivers/isdn/hisax/st5481_b.c b/drivers/isdn/hisax/st5481_b.c --- a/drivers/isdn/hisax/st5481_b.c Wed Apr 14 14:38:09 2004 +++ b/drivers/isdn/hisax/st5481_b.c Wed Apr 14 14:38:09 2004 @@ -119,7 +119,7 @@ DBG_ISO_PACKET(0x200,urb); - SUBMIT_URB(urb, GFP_KERNEL); + SUBMIT_URB(urb, GFP_NOIO); } /* @@ -171,8 +171,8 @@ buf_nr = get_buf_nr(b_out->urb, urb); test_and_clear_bit(buf_nr, &b_out->busy); - if (urb->status < 0) { - if (urb->status != -ENOENT) { + if (unlikely(urb->status < 0)) { + if (urb->status != -ENOENT && urb->status != -ESHUTDOWN) { WARN("urb status %d",urb->status); if (b_out->busy == 0) { st5481_usb_pipe_reset(adapter, (bcs->channel+1)*2 | USB_DIR_OUT, NULL, NULL); diff -Nru a/drivers/isdn/hisax/st5481_d.c b/drivers/isdn/hisax/st5481_d.c --- a/drivers/isdn/hisax/st5481_d.c Wed Apr 14 14:38:09 2004 +++ b/drivers/isdn/hisax/st5481_d.c Wed Apr 14 14:38:09 2004 @@ -381,8 +381,8 @@ buf_nr = get_buf_nr(d_out->urb, urb); test_and_clear_bit(buf_nr, &d_out->busy); - if (urb->status < 0) { - if (urb->status != -ENOENT) { + if (unlikely(urb->status < 0)) { + if (urb->status != -ENOENT && urb->status != -ESHUTDOWN) { WARN("urb status %d",urb->status); if (d_out->busy == 0) { st5481_usb_pipe_reset(adapter, EP_D_OUT | USB_DIR_OUT, fifo_reseted, adapter); @@ -649,7 +649,7 @@ st5481_usb_device_ctrl_msg(adapter, GPIO_OUT, adapter->leds, NULL, NULL); } -static int __devinit st5481_setup_d_out(struct st5481_adapter *adapter) +static int st5481_setup_d_out(struct st5481_adapter *adapter) { struct usb_device *dev = adapter->usb_dev; struct usb_host_interface *altsetting; @@ -682,7 +682,7 @@ st5481_release_isocpipes(d_out->urb); } -int __devinit st5481_setup_d(struct st5481_adapter *adapter) +int st5481_setup_d(struct st5481_adapter *adapter) { int retval; diff -Nru a/drivers/isdn/hisax/st5481_init.c b/drivers/isdn/hisax/st5481_init.c --- a/drivers/isdn/hisax/st5481_init.c Wed Apr 14 14:38:09 2004 +++ b/drivers/isdn/hisax/st5481_init.c Wed Apr 14 14:38:09 2004 @@ -58,8 +58,8 @@ * This function will be called when the adapter is plugged * into the USB bus. */ -static int __devinit probe_st5481(struct usb_interface *intf, - const struct usb_device_id *id) +static int probe_st5481(struct usb_interface *intf, + const struct usb_device_id *id) { struct usb_device *dev = interface_to_usbdev(intf); struct st5481_adapter *adapter; diff -Nru a/drivers/isdn/hisax/st5481_usb.c b/drivers/isdn/hisax/st5481_usb.c --- a/drivers/isdn/hisax/st5481_usb.c Wed Apr 14 14:38:09 2004 +++ b/drivers/isdn/hisax/st5481_usb.c Wed Apr 14 14:38:09 2004 @@ -48,7 +48,7 @@ // Prepare the URB urb->dev = adapter->usb_dev; - SUBMIT_URB(urb, GFP_KERNEL); + SUBMIT_URB(urb, GFP_ATOMIC); } /* @@ -129,8 +129,8 @@ struct st5481_ctrl *ctrl = &adapter->ctrl; struct ctrl_msg *ctrl_msg; - if (urb->status < 0) { - if (urb->status != -ENOENT) { + if (unlikely(urb->status < 0)) { + if (urb->status != -ENOENT && urb->status != -ESHUTDOWN) { WARN("urb status %d",urb->status); } else { DBG(1,"urb killed"); @@ -239,7 +239,7 @@ * initialization */ -int __devinit st5481_setup_usb(struct st5481_adapter *adapter) +int (struct st5481_adapter *adapter) { struct usb_device *dev = adapter->usb_dev; struct st5481_ctrl *ctrl = &adapter->ctrl; @@ -341,7 +341,7 @@ /* * Initialize the adapter. */ -void __devinit st5481_start(struct st5481_adapter *adapter) +void st5481_start(struct st5481_adapter *adapter) { static const u8 init_cmd_table[]={ SET_DEFAULT,0, @@ -381,7 +381,7 @@ /* * Reset the adapter to default values. */ -void __devexit st5481_stop(struct st5481_adapter *adapter) +void st5481_stop(struct st5481_adapter *adapter) { DBG(8,""); @@ -392,7 +392,7 @@ * isochronous USB helpers */ -static void __devinit +static void fill_isoc_urb(struct urb *urb, struct usb_device *dev, unsigned int pipe, void *buf, int num_packets, int packet_size, usb_complete_t complete, @@ -417,7 +417,7 @@ } } -int __devinit +int st5481_setup_isocpipes(struct urb* urb[2], struct usb_device *dev, unsigned int pipe, int num_packets, int packet_size, int buf_size, @@ -481,8 +481,8 @@ struct sk_buff *skb; int len, count, status; - if (urb->status < 0) { - if (urb->status != -ENOENT) { + if (unlikely(urb->status < 0)) { + if (urb->status != -ENOENT && urb->status != -ESHUTDOWN) { WARN("urb status %d",urb->status); } else { DBG(1,"urb killed"); @@ -529,10 +529,10 @@ urb->dev = in->adapter->usb_dev; urb->actual_length = 0; - SUBMIT_URB(urb, GFP_KERNEL); + SUBMIT_URB(urb, GFP_ATOMIC); } -int __devinit st5481_setup_in(struct st5481_in *in) +int st5481_setup_in(struct st5481_in *in) { struct usb_device *dev = in->adapter->usb_dev; int retval;