aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/line6/pod.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-01-20 08:42:42 +0100
committerTakashi Iwai <tiwai@suse.de>2015-01-28 07:19:37 +0100
commit8a3b7c086a509d90c312ebab6d8e5a9bf48c6cf5 (patch)
tree89c8dd81edfc0148e3c5a5a54aa93892739e58db /sound/usb/line6/pod.c
parentALSA: line6: Abort if inconsistent usbdev is found at disconnect (diff)
downloadlinux-dev-8a3b7c086a509d90c312ebab6d8e5a9bf48c6cf5.tar.xz
linux-dev-8a3b7c086a509d90c312ebab6d8e5a9bf48c6cf5.zip
ALSA: line6: Remove superfluous NULL checks in each driver
The interface and driver objects are always set when callbacks are called. Drop such superfluous NULL checks in init and disconnect calls of each driver. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/line6/pod.c')
-rw-r--r--sound/usb/line6/pod.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/sound/usb/line6/pod.c b/sound/usb/line6/pod.c
index bf027fc70cba..26ecf26a33ec 100644
--- a/sound/usb/line6/pod.c
+++ b/sound/usb/line6/pod.c
@@ -401,25 +401,16 @@ static struct snd_kcontrol_new pod_control_monitor = {
*/
static void line6_pod_disconnect(struct usb_interface *interface)
{
- struct usb_line6_pod *pod;
-
- if (interface == NULL)
- return;
- pod = usb_get_intfdata(interface);
-
- if (pod != NULL) {
- struct device *dev = &interface->dev;
+ struct usb_line6_pod *pod = usb_get_intfdata(interface);
+ struct device *dev = &interface->dev;
- if (dev != NULL) {
- /* remove sysfs entries: */
- device_remove_file(dev, &dev_attr_device_id);
- device_remove_file(dev, &dev_attr_firmware_version);
- device_remove_file(dev, &dev_attr_serial_number);
- }
+ /* remove sysfs entries: */
+ device_remove_file(dev, &dev_attr_device_id);
+ device_remove_file(dev, &dev_attr_firmware_version);
+ device_remove_file(dev, &dev_attr_serial_number);
- del_timer_sync(&pod->startup_timer);
- cancel_work_sync(&pod->startup_work);
- }
+ del_timer_sync(&pod->startup_timer);
+ cancel_work_sync(&pod->startup_work);
}
/*
@@ -456,9 +447,6 @@ static int pod_init(struct usb_interface *interface,
init_timer(&pod->startup_timer);
INIT_WORK(&pod->startup_work, pod_startup4);
- if ((interface == NULL) || (pod == NULL))
- return -ENODEV;
-
/* create sysfs entries: */
err = pod_create_files2(&interface->dev);
if (err < 0)