[media] redrat3: remove dead code and pointless messages
authorSean Young <sean@mess.org>
Mon, 31 Oct 2016 17:52:21 +0000 (15:52 -0200)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 21 Nov 2016 14:24:58 +0000 (12:24 -0200)
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>
drivers/media/rc/redrat3.c

index 236b686bffd644eac924ac53a29719e7576c490a..09e34a73d6639dfc7273d60c51acc83fb9dfee32 100644 (file)
@@ -363,11 +363,6 @@ static void redrat3_process_ir_data(struct redrat3_dev *rr3)
        unsigned int i, sig_size, single_len, offset, val;
        u32 mod_freq;
 
-       if (!rr3) {
-               pr_err("%s called with no context!\n", __func__);
-               return;
-       }
-
        dev = rr3->dev;
 
        mod_freq = redrat3_val_to_mod_freq(&rr3->irdata);
@@ -693,19 +688,9 @@ out:
 /* callback function from USB when async USB request has completed */
 static void redrat3_handle_async(struct urb *urb)
 {
-       struct redrat3_dev *rr3;
+       struct redrat3_dev *rr3 = urb->context;
        int ret;
 
-       if (!urb)
-               return;
-
-       rr3 = urb->context;
-       if (!rr3) {
-               pr_err("%s called with invalid context!\n", __func__);
-               usb_unlink_urb(urb);
-               return;
-       }
-
        switch (urb->status) {
        case 0:
                ret = redrat3_get_ir_data(rr3, urb->actual_length);
@@ -1069,8 +1054,6 @@ error:
        redrat3_delete(rr3, rr3->udev);
 
 no_endpoints:
-       dev_err(dev, "%s: retval = %x", __func__, retval);
-
        return retval;
 }
 
@@ -1079,9 +1062,6 @@ static void redrat3_dev_disconnect(struct usb_interface *intf)
        struct usb_device *udev = interface_to_usbdev(intf);
        struct redrat3_dev *rr3 = usb_get_intfdata(intf);
 
-       if (!rr3)
-               return;
-
        usb_set_intfdata(intf, NULL);
        rc_unregister_device(rr3->rc);
        led_classdev_unregister(&rr3->led);