greybus: remove redundant latency-tag sanity checks
authorJohan Hovold <johan@hovoldconsulting.com>
Wed, 25 May 2016 20:18:15 +0000 (22:18 +0200)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 27 May 2016 05:34:29 +0000 (22:34 -0700)
Core will never call host-device callbacks with invalid arguments (and
that would still need to be verified in bridge firmware anyway), so
remove the redundant and insufficient sanity check from the callbacks.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/es2.c

index 947ebae..5bd348f 100644 (file)
@@ -622,11 +622,6 @@ static int latency_tag_enable(struct gb_host_device *hd, u16 cport_id)
        struct es2_ap_dev *es2 = hd_to_es2(hd);
        struct usb_device *udev = es2->usb_dev;
 
        struct es2_ap_dev *es2 = hd_to_es2(hd);
        struct usb_device *udev = es2->usb_dev;
 
-       if (!cport_id_valid(hd, cport_id)) {
-               dev_err(&udev->dev, "invalid cport %u\n", cport_id);
-               return -EINVAL;
-       }
-
        retval = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
                                 GB_APB_REQUEST_LATENCY_TAG_EN,
                                 USB_DIR_OUT | USB_TYPE_VENDOR |
        retval = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
                                 GB_APB_REQUEST_LATENCY_TAG_EN,
                                 USB_DIR_OUT | USB_TYPE_VENDOR |
@@ -645,11 +640,6 @@ static int latency_tag_disable(struct gb_host_device *hd, u16 cport_id)
        struct es2_ap_dev *es2 = hd_to_es2(hd);
        struct usb_device *udev = es2->usb_dev;
 
        struct es2_ap_dev *es2 = hd_to_es2(hd);
        struct usb_device *udev = es2->usb_dev;
 
-       if (!cport_id_valid(hd, cport_id)) {
-               dev_err(&udev->dev, "invalid cport %u\n", cport_id);
-               return -EINVAL;
-       }
-
        retval = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
                                 GB_APB_REQUEST_LATENCY_TAG_DIS,
                                 USB_DIR_OUT | USB_TYPE_VENDOR |
        retval = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
                                 GB_APB_REQUEST_LATENCY_TAG_DIS,
                                 USB_DIR_OUT | USB_TYPE_VENDOR |