aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2011-10-27 11:20:21 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-11-14 16:47:47 -0500
commit97ff22ee3b4cb3a334f7385e269773141aed702f (patch)
tree89f7c12ef4cc757305d7a741345e0f2531c12565 /drivers
parent583182ba5f02c8c9be82ea550f2051eaec15b975 (diff)
USB: workaround for bug in old version of GCC
This patch (as1491) works around a bug in GCC-3.4.6, which is still supposed to be supported. The number of microseconds in the udelay() call in quirk_usb_disable_ehci() is fixed at 100, but the compiler doesn't understand this and generates a link-time error. So we replace the otherwise unused variable "delta" with a simple constant 100. This same pattern is already used in other delay loops in that source file. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Reported-by: Konrad Rzepecki <krzepecki@dentonet.pl> Tested-by: Konrad Rzepecki <krzepecki@dentonet.pl> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/host/pci-quirks.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
index 27a3dec32fa2..c7fd6ce11904 100644
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -627,7 +627,7 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
627 void __iomem *base, *op_reg_base; 627 void __iomem *base, *op_reg_base;
628 u32 hcc_params, cap, val; 628 u32 hcc_params, cap, val;
629 u8 offset, cap_length; 629 u8 offset, cap_length;
630 int wait_time, delta, count = 256/4; 630 int wait_time, count = 256/4;
631 631
632 if (!mmio_resource_enabled(pdev, 0)) 632 if (!mmio_resource_enabled(pdev, 0))
633 return; 633 return;
@@ -673,11 +673,10 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
673 writel(val, op_reg_base + EHCI_USBCMD); 673 writel(val, op_reg_base + EHCI_USBCMD);
674 674
675 wait_time = 2000; 675 wait_time = 2000;
676 delta = 100;
677 do { 676 do {
678 writel(0x3f, op_reg_base + EHCI_USBSTS); 677 writel(0x3f, op_reg_base + EHCI_USBSTS);
679 udelay(delta); 678 udelay(100);
680 wait_time -= delta; 679 wait_time -= 100;
681 val = readl(op_reg_base + EHCI_USBSTS); 680 val = readl(op_reg_base + EHCI_USBSTS);
682 if ((val == ~(u32)0) || (val & EHCI_USBSTS_HALTED)) { 681 if ((val == ~(u32)0) || (val & EHCI_USBSTS_HALTED)) {
683 break; 682 break;