]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
usb: core: introduce a new usb_get_std_status() helper
authorFelipe Balbi <felipe.balbi@linux.intel.com>
Thu, 2 Nov 2017 08:57:40 +0000 (10:57 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 7 Nov 2017 14:47:19 +0000 (15:47 +0100)
This new helper is a simple wrapper around usb_get_status(). This
patch is in preparation to adding support for fetching PTM_STATUS
types. No functional changes.

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wlan-ng/hfa384x_usb.c
drivers/usb/core/driver.c
drivers/usb/core/hub.c
drivers/usb/misc/usbtest.c
include/linux/usb.h

index d1e8218f96fbbf810e1ad6fa607949a2f5c6a017..d24f5eba93751f990c13abdda0300a3be00194ea 100644 (file)
@@ -2460,7 +2460,7 @@ int hfa384x_drvr_start(struct hfa384x *hw)
         * ok
         */
        result =
-           usb_get_status(hw->usb, USB_RECIP_ENDPOINT, hw->endp_in, &status);
+           usb_get_std_status(hw->usb, USB_RECIP_ENDPOINT, hw->endp_in, &status);
        if (result < 0) {
                netdev_err(hw->wlandev->netdev, "Cannot get bulk in endpoint status.\n");
                goto done;
@@ -2469,7 +2469,7 @@ int hfa384x_drvr_start(struct hfa384x *hw)
                netdev_err(hw->wlandev->netdev, "Failed to reset bulk in endpoint.\n");
 
        result =
-           usb_get_status(hw->usb, USB_RECIP_ENDPOINT, hw->endp_out, &status);
+           usb_get_std_status(hw->usb, USB_RECIP_ENDPOINT, hw->endp_out, &status);
        if (result < 0) {
                netdev_err(hw->wlandev->netdev, "Cannot get bulk out endpoint status.\n");
                goto done;
index 4b941a3a746e63b85527ba6847e621c4ed229c3c..64262a9a882901a3f7052cc714a202a4c9ee51c0 100644 (file)
@@ -1340,8 +1340,8 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg)
                        int err;
                        u16 devstat;
 
-                       err = usb_get_status(udev, USB_RECIP_DEVICE, 0,
-                                            &devstat);
+                       err = usb_get_std_status(udev, USB_RECIP_DEVICE, 0,
+                                                &devstat);
                        if (err) {
                                dev_err(&udev->dev,
                                        "Failed to suspend device, error %d\n",
index 3edcaf10569223a79e04760abf62bd6738f39424..7ccdd3d4db84c9d4675084d4a575f458fd1e1d44 100644 (file)
@@ -1482,7 +1482,7 @@ static int hub_configure(struct usb_hub *hub,
        /* power budgeting mostly matters with bus-powered hubs,
         * and battery-powered root hubs (may provide just 8 mA).
         */
-       ret = usb_get_status(hdev, USB_RECIP_DEVICE, 0, &hubstatus);
+       ret = usb_get_std_status(hdev, USB_RECIP_DEVICE, 0, &hubstatus);
        if (ret) {
                message = "can't get hub status";
                goto fail;
@@ -3279,7 +3279,7 @@ static int finish_port_resume(struct usb_device *udev)
         */
        if (status == 0) {
                devstatus = 0;
-               status = usb_get_status(udev, USB_RECIP_DEVICE, 0, &devstatus);
+               status = usb_get_std_status(udev, USB_RECIP_DEVICE, 0, &devstatus);
 
                /* If a normal resume failed, try doing a reset-resume */
                if (status && !udev->reset_resume && udev->persist_enabled) {
@@ -3303,7 +3303,7 @@ static int finish_port_resume(struct usb_device *udev)
                        if (devstatus & (1 << USB_DEVICE_REMOTE_WAKEUP))
                                status = usb_disable_remote_wakeup(udev);
                } else {
-                       status = usb_get_status(udev, USB_RECIP_INTERFACE, 0,
+                       status = usb_get_std_status(udev, USB_RECIP_INTERFACE, 0,
                                        &devstatus);
                        if (!status && devstatus & (USB_INTRF_STAT_FUNC_RW_CAP
                                        | USB_INTRF_STAT_FUNC_RW))
@@ -4866,7 +4866,7 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
                                && udev->bus_mA <= unit_load) {
                        u16     devstat;
 
-                       status = usb_get_status(udev, USB_RECIP_DEVICE, 0,
+                       status = usb_get_std_status(udev, USB_RECIP_DEVICE, 0,
                                        &devstat);
                        if (status) {
                                dev_dbg(&udev->dev, "get status %d ?\n", status);
index aeda01f037c16966d92a153c5569a229dac32373..203f29894bcefec4be970a669e065214d056bacb 100644 (file)
@@ -1016,7 +1016,7 @@ static int ch9_postconfig(struct usbtest_dev *dev)
        /* FIXME fetch strings from at least the device descriptor */
 
        /* [9.4.5] get_status always works */
-       retval = usb_get_status(udev, USB_RECIP_DEVICE, 0, dev->buf);
+       retval = usb_get_std_status(udev, USB_RECIP_DEVICE, 0, dev->buf);
        if (retval) {
                dev_err(&iface->dev, "get dev status --> %d\n", retval);
                return retval;
@@ -1026,7 +1026,7 @@ static int ch9_postconfig(struct usbtest_dev *dev)
         * the device's remote wakeup feature ... if we can, test that here
         */
 
-       retval = usb_get_status(udev, USB_RECIP_INTERFACE,
+       retval = usb_get_std_status(udev, USB_RECIP_INTERFACE,
                        iface->altsetting[0].desc.bInterfaceNumber, dev->buf);
        if (retval) {
                dev_err(&iface->dev, "get interface status --> %d\n", retval);
@@ -1615,7 +1615,7 @@ static int verify_not_halted(struct usbtest_dev *tdev, int ep, struct urb *urb)
        u16     status;
 
        /* shouldn't look or act halted */
-       retval = usb_get_status(urb->dev, USB_RECIP_ENDPOINT, ep, &status);
+       retval = usb_get_std_status(urb->dev, USB_RECIP_ENDPOINT, ep, &status);
        if (retval < 0) {
                ERROR(tdev, "ep %02x couldn't get no-halt status, %d\n",
                                ep, retval);
@@ -1637,7 +1637,7 @@ static int verify_halted(struct usbtest_dev *tdev, int ep, struct urb *urb)
        u16     status;
 
        /* should look and act halted */
-       retval = usb_get_status(urb->dev, USB_RECIP_ENDPOINT, ep, &status);
+       retval = usb_get_std_status(urb->dev, USB_RECIP_ENDPOINT, ep, &status);
        if (retval < 0) {
                ERROR(tdev, "ep %02x couldn't get halt status, %d\n",
                                ep, retval);
index 2e2c1d40081b858da8af98adf329ec3a4e148284..e86b6a2a35e49aefd8164d4f0f55d55bbe63b959 100644 (file)
@@ -1767,6 +1767,13 @@ extern int usb_get_descriptor(struct usb_device *dev, unsigned char desctype,
        unsigned char descindex, void *buf, int size);
 extern int usb_get_status(struct usb_device *dev,
        int recip, int target, void *data);
+
+static inline int usb_get_std_status(struct usb_device *dev,
+       int recip, int target, void *data)
+{
+       return usb_get_status(dev, recip, target, data);
+}
+
 extern int usb_string(struct usb_device *dev, int index,
        char *buf, size_t size);