usb: host: ehci-sys: delete useless bus_to_hcd conversion
authorPeter Chen <peter.chen@freescale.com>
Mon, 17 Aug 2015 02:23:03 +0000 (10:23 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 18 Aug 2015 17:05:23 +0000 (10:05 -0700)
The ehci platform device's drvdata is the pointer of struct usb_hcd
already, so we doesn't need to call bus_to_hcd conversion again.

Cc: <stable@vger.kernel.org>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ehci-sysfs.c

index 5e44407aa09972801bb759f729033ba21cc214d2..5216f2b09d633e0b29d3d0cdf361e1c76763db19 100644 (file)
@@ -29,7 +29,7 @@ static ssize_t show_companion(struct device *dev,
        int                     count = PAGE_SIZE;
        char                    *ptr = buf;
 
-       ehci = hcd_to_ehci(bus_to_hcd(dev_get_drvdata(dev)));
+       ehci = hcd_to_ehci(dev_get_drvdata(dev));
        nports = HCS_N_PORTS(ehci->hcs_params);
 
        for (index = 0; index < nports; ++index) {
@@ -54,7 +54,7 @@ static ssize_t store_companion(struct device *dev,
        struct ehci_hcd         *ehci;
        int                     portnum, new_owner;
 
-       ehci = hcd_to_ehci(bus_to_hcd(dev_get_drvdata(dev)));
+       ehci = hcd_to_ehci(dev_get_drvdata(dev));
        new_owner = PORT_OWNER;         /* Owned by companion */
        if (sscanf(buf, "%d", &portnum) != 1)
                return -EINVAL;
@@ -85,7 +85,7 @@ static ssize_t show_uframe_periodic_max(struct device *dev,
        struct ehci_hcd         *ehci;
        int                     n;
 
-       ehci = hcd_to_ehci(bus_to_hcd(dev_get_drvdata(dev)));
+       ehci = hcd_to_ehci(dev_get_drvdata(dev));
        n = scnprintf(buf, PAGE_SIZE, "%d\n", ehci->uframe_periodic_max);
        return n;
 }
@@ -101,7 +101,7 @@ static ssize_t store_uframe_periodic_max(struct device *dev,
        unsigned long           flags;
        ssize_t                 ret;
 
-       ehci = hcd_to_ehci(bus_to_hcd(dev_get_drvdata(dev)));
+       ehci = hcd_to_ehci(dev_get_drvdata(dev));
        if (kstrtouint(buf, 0, &uframe_periodic_max) < 0)
                return -EINVAL;