diff options
Diffstat (limited to 'drivers/usb/atm')
-rw-r--r-- | drivers/usb/atm/speedtch.c | 18 | ||||
-rw-r--r-- | drivers/usb/atm/ueagle-atm.c | 4 | ||||
-rw-r--r-- | drivers/usb/atm/usbatm.c | 6 | ||||
-rw-r--r-- | drivers/usb/atm/xusbatm.c | 6 |
4 files changed, 22 insertions, 12 deletions
diff --git a/drivers/usb/atm/speedtch.c b/drivers/usb/atm/speedtch.c index bcc9ca79e..9e46c3d89 100644 --- a/drivers/usb/atm/speedtch.c +++ b/drivers/usb/atm/speedtch.c @@ -255,7 +255,8 @@ static int speedtch_upload_firmware(struct speedtch_instance_data *instance, usb_dbg(usbatm, "%s entered\n", __func__); - if (!(buffer = (unsigned char *)__get_free_page(GFP_KERNEL))) { + buffer = (unsigned char *)__get_free_page(GFP_KERNEL); + if (!buffer) { ret = -ENOMEM; usb_dbg(usbatm, "%s: no memory for buffer!\n", __func__); goto out; @@ -638,7 +639,8 @@ static void speedtch_handle_int(struct urb *int_urb) goto fail; } - if ((int_urb = instance->int_urb)) { + int_urb = instance->int_urb; + if (int_urb) { ret = usb_submit_urb(int_urb, GFP_ATOMIC); schedule_work(&instance->status_check_work); if (ret < 0) { @@ -650,7 +652,8 @@ static void speedtch_handle_int(struct urb *int_urb) return; fail: - if ((int_urb = instance->int_urb)) + int_urb = instance->int_urb; + if (int_urb) mod_timer(&instance->resubmit_timer, jiffies + msecs_to_jiffies(RESUBMIT_DELAY)); } @@ -759,11 +762,13 @@ static void speedtch_release_interfaces(struct usb_device *usb_dev, struct usb_interface *cur_intf; int i; - for (i = 0; i < num_interfaces; i++) - if ((cur_intf = usb_ifnum_to_if(usb_dev, i))) { + for (i = 0; i < num_interfaces; i++) { + cur_intf = usb_ifnum_to_if(usb_dev, i); + if (cur_intf) { usb_set_intfdata(cur_intf, NULL); usb_driver_release_interface(&speedtch_usb_driver, cur_intf); } + } } static int speedtch_bind(struct usbatm_data *usbatm, @@ -787,7 +792,8 @@ static int speedtch_bind(struct usbatm_data *usbatm, return -ENODEV; } - if (!(data_intf = usb_ifnum_to_if(usb_dev, INTERFACE_DATA))) { + data_intf = usb_ifnum_to_if(usb_dev, INTERFACE_DATA); + if (!data_intf) { usb_err(usbatm, "%s: data interface not found!\n", __func__); return -ENODEV; } diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c index 750407329..2a3d0dcaf 100644 --- a/drivers/usb/atm/ueagle-atm.c +++ b/drivers/usb/atm/ueagle-atm.c @@ -1599,7 +1599,7 @@ static void cmvs_file_name(struct uea_softc *sc, char *const cmv_name, int ver) char file_arr[] = "/*(DEBLOBBED)*/"; char *file; - kparam_block_sysfs_write(cmv_file); + kernel_param_lock(THIS_MODULE); /* set proper name corresponding modem version and line type */ if (cmv_file[sc->modem_index] == NULL) { if (UEA_CHIP_VERSION(sc) == ADI930) @@ -1618,7 +1618,7 @@ static void cmvs_file_name(struct uea_softc *sc, char *const cmv_name, int ver) strlcat(cmv_name, file, UEA_FW_NAME_MAX); if (ver == 2) strlcat(cmv_name, ".v2", UEA_FW_NAME_MAX); - kparam_unblock_sysfs_write(cmv_file); + kernel_param_unlock(THIS_MODULE); } static int request_cmvs_old(struct uea_softc *sc, diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c index dada0146c..db322d9cc 100644 --- a/drivers/usb/atm/usbatm.c +++ b/drivers/usb/atm/usbatm.c @@ -382,7 +382,8 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char "%s: got packet (length: %u, pdu_length: %u, vcc: 0x%p)", __func__, length, pdu_length, vcc); - if (!(skb = dev_alloc_skb(length))) { + skb = dev_alloc_skb(length); + if (!skb) { if (printk_ratelimit()) atm_err(instance, "%s: no memory for skb (length: %u)!\n", __func__, length); @@ -816,7 +817,8 @@ static int usbatm_atm_open(struct atm_vcc *vcc) goto fail; } - if (!(new = kzalloc(sizeof(struct usbatm_vcc_data), GFP_KERNEL))) { + new = kzalloc(sizeof(struct usbatm_vcc_data), GFP_KERNEL); + if (!new) { atm_err(instance, "%s: no memory for vcc_data!\n", __func__); ret = -ENOMEM; goto fail; diff --git a/drivers/usb/atm/xusbatm.c b/drivers/usb/atm/xusbatm.c index b3b1bb78b..a87597f88 100644 --- a/drivers/usb/atm/xusbatm.c +++ b/drivers/usb/atm/xusbatm.c @@ -73,7 +73,8 @@ static int xusbatm_capture_intf(struct usbatm_data *usbatm, struct usb_device *u usb_err(usbatm, "%s: failed to claim interface %2d (%d)!\n", __func__, ifnum, ret); return ret; } - if ((ret = usb_set_interface(usb_dev, ifnum, altsetting))) { + ret = usb_set_interface(usb_dev, ifnum, altsetting); + if (ret) { usb_err(usbatm, "%s: altsetting %2d for interface %2d failed (%d)!\n", __func__, altsetting, ifnum, ret); return ret; } @@ -128,7 +129,8 @@ static int xusbatm_bind(struct usbatm_data *usbatm, rx_intf->altsetting->desc.bInterfaceNumber, tx_intf->altsetting->desc.bInterfaceNumber); - if ((ret = xusbatm_capture_intf(usbatm, usb_dev, rx_intf, rx_alt, rx_intf != intf))) + ret = xusbatm_capture_intf(usbatm, usb_dev, rx_intf, rx_alt, rx_intf != intf); + if (ret) return ret; if ((tx_intf != rx_intf) && (ret = xusbatm_capture_intf(usbatm, usb_dev, tx_intf, tx_alt, tx_intf != intf))) { |