Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] redrat3: remove dead code and pointless messages

Cleanup the error logic, removing checks for things that
should be always initialized when the routines are called,
and remove some bogus messages.

[mchehab@s-opensource.com: fix some merge conflicts]
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>

authored by

Sean Young and committed by
Mauro Carvalho Chehab
d6aca6ea da500033

+1 -21
+1 -21
drivers/media/rc/redrat3.c
··· 363 363 unsigned int i, sig_size, single_len, offset, val; 364 364 u32 mod_freq; 365 365 366 - if (!rr3) { 367 - pr_err("%s called with no context!\n", __func__); 368 - return; 369 - } 370 - 371 366 dev = rr3->dev; 372 367 373 368 mod_freq = redrat3_val_to_mod_freq(&rr3->irdata); ··· 688 693 /* callback function from USB when async USB request has completed */ 689 694 static void redrat3_handle_async(struct urb *urb) 690 695 { 691 - struct redrat3_dev *rr3; 696 + struct redrat3_dev *rr3 = urb->context; 692 697 int ret; 693 - 694 - if (!urb) 695 - return; 696 - 697 - rr3 = urb->context; 698 - if (!rr3) { 699 - pr_err("%s called with invalid context!\n", __func__); 700 - usb_unlink_urb(urb); 701 - return; 702 - } 703 698 704 699 switch (urb->status) { 705 700 case 0: ··· 1054 1069 redrat3_delete(rr3, rr3->udev); 1055 1070 1056 1071 no_endpoints: 1057 - dev_err(dev, "%s: retval = %x", __func__, retval); 1058 - 1059 1072 return retval; 1060 1073 } 1061 1074 ··· 1061 1078 { 1062 1079 struct usb_device *udev = interface_to_usbdev(intf); 1063 1080 struct redrat3_dev *rr3 = usb_get_intfdata(intf); 1064 - 1065 - if (!rr3) 1066 - return; 1067 1081 1068 1082 usb_set_intfdata(intf, NULL); 1069 1083 rc_unregister_device(rr3->rc);