[alsa-devel] [PATCH 1/7] ALSA: line6: Yet more cleanup of superfluous NULL checks

Takashi Iwai tiwai at suse.de
Tue Jan 20 10:04:16 CET 2015


... in line6_disconnect() as well.

Signed-off-by: Takashi Iwai <tiwai at suse.de>
---
 sound/usb/line6/driver.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/sound/usb/line6/driver.c b/sound/usb/line6/driver.c
index 93cd4daa56bc..e8d51381ffdb 100644
--- a/sound/usb/line6/driver.c
+++ b/sound/usb/line6/driver.c
@@ -579,18 +579,9 @@ EXPORT_SYMBOL_GPL(line6_probe);
 */
 void line6_disconnect(struct usb_interface *interface)
 {
-	struct usb_line6 *line6;
-	struct usb_device *usbdev;
-	int interface_number;
-
-	if (interface == NULL)
-		return;
-	usbdev = interface_to_usbdev(interface);
-	if (usbdev == NULL)
-		return;
+	struct usb_line6 *line6 = usb_get_intfdata(interface);
+	struct usb_device *usbdev = interface_to_usbdev(interface);
 
-	interface_number = interface->cur_altsetting->desc.bInterfaceNumber;
-	line6 = usb_get_intfdata(interface);
 	if (!line6)
 		return;
 
-- 
2.2.1



More information about the Alsa-devel mailing list