Commit c4c9fbebae6a62d538817d0ccee698adaafc5d66
Committed by
Wolfgang Denk
1 parent
712fbcf384
Exists in
master
and in
54 other branches
consolidate mdelay by providing a common function for all users
There are several mdelay() definitions in the driver and board code. Remove them all and provide a common mdelay() in lib/time.c. Signed-off-by: Anatolij Gustschin <agust@denx.de> Acked-by: Mike Frysinger <vapier@gentoo.org>
Showing 20 changed files with 7 additions and 43 deletions Side-by-side Diff
- arch/arm/cpu/arm920t/s3c24x0/usb_ohci.c
- arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c
- arch/powerpc/cpu/mpc5xxx/usb_ohci.c
- arch/powerpc/cpu/ppc4xx/usb_ohci.c
- arch/powerpc/include/asm/4xx_pcie.h
- board/amcc/taishan/lcd.c
- board/freescale/mx35pdk/mx35pdk.c
- board/karo/tx25/tx25.c
- board/linkstation/hwctl.c
- drivers/block/fsl_sata.c
- drivers/block/ftide020.c
- drivers/net/e1000.c
- drivers/net/ftgmac100.c
- drivers/net/ne2000.c
- drivers/net/ne2000_base.c
- drivers/net/smc911x.c
- drivers/usb/host/ohci-hcd.c
- drivers/usb/host/sl811-hcd.c
- include/common.h
- lib/time.c
arch/arm/cpu/arm920t/s3c24x0/usb_ohci.c
... | ... | @@ -1540,7 +1540,6 @@ |
1540 | 1540 | writel(RH_HS_LPSC, &ohci->regs->roothub.status); |
1541 | 1541 | #endif /* OHCI_USE_NPS */ |
1542 | 1542 | |
1543 | -#define mdelay(n) ({unsigned long msec=(n); while (msec--) udelay(1000);}) | |
1544 | 1543 | /* POTPGT delay is bits 24-31, in 2 ms units. */ |
1545 | 1544 | mdelay((roothub_a(ohci) >> 23) & 0x1fe); |
1546 | 1545 |
arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c
... | ... | @@ -1448,7 +1448,6 @@ |
1448 | 1448 | writel (RH_HS_LPSC, &ohci->regs->roothub.status); |
1449 | 1449 | #endif /* OHCI_USE_NPS */ |
1450 | 1450 | |
1451 | -#define mdelay(n) ({unsigned long msec=(n); while (msec--) udelay(1000);}) | |
1452 | 1451 | /* POTPGT delay is bits 24-31, in 2 ms units. */ |
1453 | 1452 | mdelay ((roothub_a (ohci) >> 23) & 0x1fe); |
1454 | 1453 |
arch/powerpc/cpu/mpc5xxx/usb_ohci.c
... | ... | @@ -1455,7 +1455,6 @@ |
1455 | 1455 | writel (RH_HS_LPSC, &ohci->regs->roothub.status); |
1456 | 1456 | #endif /* OHCI_USE_NPS */ |
1457 | 1457 | |
1458 | -#define mdelay(n) ({unsigned long msec=(n); while (msec--) udelay(1000);}) | |
1459 | 1458 | /* POTPGT delay is bits 24-31, in 2 ms units. */ |
1460 | 1459 | mdelay ((roothub_a (ohci) >> 23) & 0x1fe); |
1461 | 1460 |
arch/powerpc/cpu/ppc4xx/usb_ohci.c
... | ... | @@ -1462,7 +1462,6 @@ |
1462 | 1462 | writel (RH_HS_LPSC, &ohci->regs->roothub.status); |
1463 | 1463 | #endif /* OHCI_USE_NPS */ |
1464 | 1464 | |
1465 | -#define mdelay(n) ({unsigned long msec=(n); while (msec--) udelay(1000);}) | |
1466 | 1465 | /* POTPGT delay is bits 24-31, in 2 ms units. */ |
1467 | 1466 | mdelay ((roothub_a (ohci) >> 23) & 0x1fe); |
1468 | 1467 |
arch/powerpc/include/asm/4xx_pcie.h
board/amcc/taishan/lcd.c
... | ... | @@ -35,8 +35,6 @@ |
35 | 35 | #define LCD_DATA_ADDR ((volatile char *)(CONFIG_SYS_EBC2_LCM_BASE+1)) |
36 | 36 | #define LCD_BLK_CTRL ((volatile char *)(CONFIG_SYS_EBC1_FPGA_BASE+0x2)) |
37 | 37 | |
38 | -#define mdelay(t) ({unsigned long msec=(t); while (msec--) { udelay(1000);}}) | |
39 | - | |
40 | 38 | static int g_lcd_init_b = 0; |
41 | 39 | static char *amcc_logo = " AMCC TAISHAN 440GX EvalBoard"; |
42 | 40 | static char addr_flag = 0x80; |
board/freescale/mx35pdk/mx35pdk.c
board/karo/tx25/tx25.c
board/linkstation/hwctl.c
drivers/block/fsl_sata.c
drivers/block/ftide020.c
... | ... | @@ -54,8 +54,6 @@ |
54 | 54 | #define WRITE_CMD(x) outl((x), &ftide020->cmd_fifo) /* 0x04 */ |
55 | 55 | #define READ_STATUS() inl(&ftide020->cmd_fifo) /* 0x04 */ |
56 | 56 | |
57 | -#define mdelay(n) ({unsigned long msec = (n); while (msec--) udelay(1000); }) | |
58 | - | |
59 | 57 | void ftide_set_device(int cx8, int dev) |
60 | 58 | { |
61 | 59 | static struct ftide020_s *ftide020 = (struct ftide020_s *) FTIDE_BASE; |
drivers/net/e1000.c
... | ... | @@ -50,7 +50,6 @@ |
50 | 50 | |
51 | 51 | #define virt_to_bus(devno, v) pci_virt_to_mem(devno, (void *) (v)) |
52 | 52 | #define bus_to_phys(devno, a) pci_mem_to_phys(devno, a) |
53 | -#define mdelay(n) udelay((n)*1000) | |
54 | 53 | |
55 | 54 | #define E1000_DEFAULT_PCI_PBA 0x00000030 |
56 | 55 | #define E1000_DEFAULT_PCIE_PBA 0x000a0026 |
drivers/net/ftgmac100.c
drivers/net/ne2000.c
drivers/net/ne2000_base.c
drivers/net/smc911x.c
... | ... | @@ -35,8 +35,6 @@ |
35 | 35 | void pkt_data_push(struct eth_device *dev, u32 addr, u32 val) \ |
36 | 36 | __attribute__ ((weak, alias ("smc911x_reg_write"))); |
37 | 37 | |
38 | -#define mdelay(n) udelay((n)*1000) | |
39 | - | |
40 | 38 | static void smc911x_handle_mac_address(struct eth_device *dev) |
41 | 39 | { |
42 | 40 | unsigned long addrh, addrl; |
drivers/usb/host/ohci-hcd.c
... | ... | @@ -1749,7 +1749,6 @@ |
1749 | 1749 | ohci_writel(RH_HS_LPSC, &ohci->regs->roothub.status); |
1750 | 1750 | #endif /* OHCI_USE_NPS */ |
1751 | 1751 | |
1752 | -#define mdelay(n) ({unsigned long msec = (n); while (msec--) udelay(1000); }) | |
1753 | 1752 | /* POTPGT delay is bits 24-31, in 2 ms units. */ |
1754 | 1753 | mdelay((roothub_a(ohci) >> 23) & 0x1fe); |
1755 | 1754 |
drivers/usb/host/sl811-hcd.c
include/common.h