cleanup files using checkpatch.pl

SVN-Revision: 27162
v19.07.3_mercusys_ac12_duma
Florian Fainelli 13 years ago
parent d3b8685cd7
commit 6a5112a750

@ -23,7 +23,9 @@
void __init prom_putchar(char ch) void __init prom_putchar(char ch)
{ {
while ((UART_READ(UART_REG_FLAG) & UART_FLAG_TXFE) == 0); while ((UART_READ(UART_REG_FLAG) & UART_FLAG_TXFE) == 0)
;
UART_WRITE(UART_REG_DATA, ch); UART_WRITE(UART_REG_DATA, ch);
while ((UART_READ(UART_REG_FLAG) & UART_FLAG_TXFE) == 0); while ((UART_READ(UART_REG_FLAG) & UART_FLAG_TXFE) == 0)
;
} }

@ -16,10 +16,10 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/bitops.h>
#include <asm/irq_cpu.h> #include <asm/irq_cpu.h>
#include <asm/mipsregs.h> #include <asm/mipsregs.h>
#include <asm/bitops.h>
#include <asm/mach-adm5120/adm5120_defs.h> #include <asm/mach-adm5120/adm5120_defs.h>
@ -170,7 +170,8 @@ static void __init adm5120_intc_irq_init(void)
setup_irq(ADM5120_IRQ_INTC, &adm5120_intc_irq_action); setup_irq(ADM5120_IRQ_INTC, &adm5120_intc_irq_action);
} }
void __init arch_init_irq(void) { void __init arch_init_irq(void)
{
mips_cpu_irq_init(); mips_cpu_irq_init();
adm5120_intc_irq_init(); adm5120_intc_irq_init();
} }

@ -67,7 +67,7 @@ static struct board_desc common_boards[] __initdata = {
/* OSBRiDGE boards */ /* OSBRiDGE boards */
DEFBOARD("OSBRiDGE 5GXi", MACH_ADM5120_5GXI), DEFBOARD("OSBRiDGE 5GXi", MACH_ADM5120_5GXI),
/* Motorola boards */ /* Motorola boards */
DEFBOARD("Powerline MU Gateway",MACH_ADM5120_PMUGW), DEFBOARD("Powerline MU Gateway", MACH_ADM5120_PMUGW),
/* Generic EB-214A */ /* Generic EB-214A */
DEFBOARD("ADM5120", MACH_ADM5120_EB_214A), DEFBOARD("ADM5120", MACH_ADM5120_EB_214A),
}; };
@ -249,7 +249,7 @@ static void __init prom_init_cmdline(void)
} }
#else #else
static void inline prom_init_cmdline(void) {} static inline void prom_init_cmdline(void) {}
#endif /* CONFIG_IMAGE_CMDLINE_HACK */ #endif /* CONFIG_IMAGE_CMDLINE_HACK */
void __init prom_init(void) void __init prom_init(void)

@ -20,10 +20,12 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/reboot.h>
#include <linux/time.h>
#include <asm/bootinfo.h>
#include <asm/reboot.h> #include <asm/reboot.h>
#include <asm/time.h> #include <asm/time.h>
#include <asm/bootinfo.h>
#include <asm/mips_machine.h> #include <asm/mips_machine.h>
#include <asm/mach-adm5120/adm5120_info.h> #include <asm/mach-adm5120/adm5120_info.h>
@ -49,7 +51,7 @@ static void __init adm5120_report(void)
{ {
printk(KERN_INFO "SoC : %s\n", adm5120_sys_type); printk(KERN_INFO "SoC : %s\n", adm5120_sys_type);
printk(KERN_INFO "Bootdev : %s flash\n", printk(KERN_INFO "Bootdev : %s flash\n",
adm5120_nand_boot ? "NAND":"NOR"); adm5120_nand_boot ? "NAND" : "NOR");
printk(KERN_INFO "Prom : %s\n", prom_names[adm5120_prom_type]); printk(KERN_INFO "Prom : %s\n", prom_names[adm5120_prom_type]);
} }

@ -103,7 +103,7 @@ static void __init eb214a_setup(void)
adm5120_add_device_gpio(EB214A_GPIO_DEV_MASK); adm5120_add_device_gpio(EB214A_GPIO_DEV_MASK);
adm5120_add_device_uart(0); adm5120_add_device_uart(0);
//adm5120_add_device_uart(1); /* adm5120_add_device_uart(1); */
adm5120_add_device_switch(5, eb214a_vlans); adm5120_add_device_switch(5, eb214a_vlans);
@ -117,7 +117,7 @@ static void __init eb214a_setup(void)
adm5120_pci_set_irq_map(ARRAY_SIZE(eb214a_pci_irqs), adm5120_pci_set_irq_map(ARRAY_SIZE(eb214a_pci_irqs),
eb214a_pci_irqs); eb214a_pci_irqs);
// adm5120_add_device_usb(); /* adm5120_add_device_usb(); */
} }
MIPS_MACHINE(MACH_ADM5120_EB_214A, "EB-214A", "Generic EB-214A", eb214a_setup); MIPS_MACHINE(MACH_ADM5120_EB_214A, "EB-214A", "Generic EB-214A", eb214a_setup);

@ -20,7 +20,7 @@
#define RB150_GPIO_NAND_ALE ADM5120_GPIO_P3L2 #define RB150_GPIO_NAND_ALE ADM5120_GPIO_P3L2
#define RB150_GPIO_RESET_BUTTON ADM5120_GPIO_PIN1 /* FIXME */ #define RB150_GPIO_RESET_BUTTON ADM5120_GPIO_PIN1 /* FIXME */
#define RB150_GPIO_DEV_MASK ( 1 << RB150_GPIO_NAND_READY \ #define RB150_GPIO_DEV_MASK (1 << RB150_GPIO_NAND_READY \
| 1 << RB150_GPIO_NAND_NCE \ | 1 << RB150_GPIO_NAND_NCE \
| 1 << RB150_GPIO_NAND_CLE \ | 1 << RB150_GPIO_NAND_CLE \
| 1 << RB150_GPIO_NAND_ALE) | 1 << RB150_GPIO_NAND_ALE)

@ -11,9 +11,9 @@
#include "rb-1xx.h" #include "rb-1xx.h"
#define RB153_GPIO_DEV_MASK ( 1 << ADM5120_GPIO_PIN0 \ #define RB153_GPIO_DEV_MASK (1 << ADM5120_GPIO_PIN0 \
| 1 << ADM5120_GPIO_PIN3 \ | 1 << ADM5120_GPIO_PIN3 \
| 1 << ADM5120_GPIO_PIN4 ) | 1 << ADM5120_GPIO_PIN4)
static struct resource rb153_cf_resources[] __initdata = { static struct resource rb153_cf_resources[] __initdata = {
{ {

@ -48,16 +48,16 @@
/* /*
* INTC register bits * INTC register bits
*/ */
#define INTC_INT_TIMER ( 1 << INTC_IRQ_TIMER ) #define INTC_INT_TIMER (1 << INTC_IRQ_TIMER)
#define INTC_INT_UART0 ( 1 << INTC_IRQ_UART0 ) #define INTC_INT_UART0 (1 << INTC_IRQ_UART0)
#define INTC_INT_UART1 ( 1 << INTC_IRQ_UART1 ) #define INTC_INT_UART1 (1 << INTC_IRQ_UART1)
#define INTC_INT_USBC ( 1 << INTC_IRQ_USBC ) #define INTC_INT_USBC (1 << INTC_IRQ_USBC)
#define INTC_INT_INTX0 ( 1 << INTC_IRQ_INTX0 ) #define INTC_INT_INTX0 (1 << INTC_IRQ_INTX0)
#define INTC_INT_INTX1 ( 1 << INTC_IRQ_INTX1 ) #define INTC_INT_INTX1 (1 << INTC_IRQ_INTX1)
#define INTC_INT_PCI0 ( 1 << INTC_IRQ_PCI0 ) #define INTC_INT_PCI0 (1 << INTC_IRQ_PCI0)
#define INTC_INT_PCI1 ( 1 << INTC_IRQ_PCI1 ) #define INTC_INT_PCI1 (1 << INTC_IRQ_PCI1)
#define INTC_INT_PCI2 ( 1 << INTC_IRQ_PCI2 ) #define INTC_INT_PCI2 (1 << INTC_IRQ_PCI2)
#define INTC_INT_SWITCH ( 1 << INTC_IRQ_SWITCH ) #define INTC_INT_SWITCH (1 << INTC_IRQ_SWITCH)
#define INTC_INT_ALL (( 1 << INTC_IRQ_COUNT)-1) #define INTC_INT_ALL ((1 << INTC_IRQ_COUNT) - 1)
#endif /* _MACH_ADM5120_INTC_H */ #endif /* _MACH_ADM5120_INTC_H */

@ -44,25 +44,25 @@
#define MPMC_REG_SC3 0x0260 #define MPMC_REG_SC3 0x0260
/* Control register bits */ /* Control register bits */
#define MPMC_CTRL_AM ( 1 << 1 ) /* Address Mirror */ #define MPMC_CTRL_AM (1 << 1) /* Address Mirror */
#define MPMC_CTRL_LPM ( 1 << 2 ) /* Low Power Mode */ #define MPMC_CTRL_LPM (1 << 2) /* Low Power Mode */
#define MPMC_CTRL_DWB ( 1 << 3 ) /* Drain Write Buffers */ #define MPMC_CTRL_DWB (1 << 3) /* Drain Write Buffers */
/* Status register bits */ /* Status register bits */
#define MPMC_STATUS_BUSY ( 1 << 0 ) /* Busy */ #define MPMC_STATUS_BUSY (1 << 0) /* Busy */
#define MPMC_STATUS_WBS ( 1 << 1 ) /* Write Buffer Status */ #define MPMC_STATUS_WBS (1 << 1) /* Write Buffer Status */
#define MPMC_STATUS_SRA ( 1 << 2 ) /* Self-Refresh Acknowledge*/ #define MPMC_STATUS_SRA (1 << 2) /* Self-Refresh Acknowledge*/
/* Dynamic Control register bits */ /* Dynamic Control register bits */
#define MPMC_DC_CE ( 1 << 0 ) #define MPMC_DC_CE (1 << 0)
#define MPMC_DC_DMC ( 1 << 1 ) #define MPMC_DC_DMC (1 << 1)
#define MPMC_DC_SRR ( 1 << 2 ) #define MPMC_DC_SRR (1 << 2)
#define MPMC_DC_SI_SHIFT 7 #define MPMC_DC_SI_SHIFT 7
#define MPMC_DC_SI_MASK ( 3 << 7 ) #define MPMC_DC_SI_MASK (3 << 7)
#define MPMC_DC_SI_NORMAL ( 0 << 7 ) #define MPMC_DC_SI_NORMAL (0 << 7)
#define MPMC_DC_SI_MODE ( 1 << 7 ) #define MPMC_DC_SI_MODE (1 << 7)
#define MPMC_DC_SI_PALL ( 2 << 7 ) #define MPMC_DC_SI_PALL (2 << 7)
#define MPMC_DC_SI_NOP ( 3 << 7 ) #define MPMC_DC_SI_NOP (3 << 7)
#define SRAM_REG_CONF 0x00 #define SRAM_REG_CONF 0x00
#define SRAM_REG_WWE 0x04 #define SRAM_REG_WWE 0x04

@ -46,7 +46,7 @@
#define NAND_READ_REG(r) \ #define NAND_READ_REG(r) \
readb((void __iomem *)KSEG1ADDR(ADM5120_NAND_BASE) + (r)) readb((void __iomem *)KSEG1ADDR(ADM5120_NAND_BASE) + (r))
#define NAND_WRITE_REG(r, v) \ #define NAND_WRITE_REG(r, v) \
writeb((v),(void __iomem *)KSEG1ADDR(ADM5120_NAND_BASE) + (r)) writeb((v), (void __iomem *)KSEG1ADDR(ADM5120_NAND_BASE) + (r))
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/

@ -45,7 +45,7 @@ struct adm5120_pci_irq {
unsigned irq; unsigned irq;
}; };
#define PCIIRQ(s,f,p,i) {.slot = (s), .func = (f), .pin = (p), .irq = (i)} #define PCIIRQ(s, f, p, i) {.slot = (s), .func = (f), .pin = (p), .irq = (i)}
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
extern void adm5120_pci_set_irq_map(unsigned int nr_irqs, extern void adm5120_pci_set_irq_map(unsigned int nr_irqs,

@ -27,38 +27,38 @@
#define UART_REG_FLAG 0x18 #define UART_REG_FLAG 0x18
/* Receive Status Register bits */ /* Receive Status Register bits */
#define UART_RSR_FE ( 1 << 0 ) #define UART_RSR_FE (1 << 0)
#define UART_RSR_PE ( 1 << 1 ) #define UART_RSR_PE (1 << 1)
#define UART_RSR_BE ( 1 << 2 ) #define UART_RSR_BE (1 << 2)
#define UART_RSR_OE ( 1 << 3 ) #define UART_RSR_OE (1 << 3)
#define UART_RSR_ERR ( UART_RSR_FE | UART_RSR_PE | UART_RSR_BE ) #define UART_RSR_ERR (UART_RSR_FE | UART_RSR_PE | UART_RSR_BE)
#define UART_ECR_ALL 0xFF #define UART_ECR_ALL 0xFF
/* Line Control High register bits */ /* Line Control High register bits */
#define UART_LCRH_BRK ( 1 << 0 ) /* send break */ #define UART_LCRH_BRK (1 << 0) /* send break */
#define UART_LCRH_PEN ( 1 << 1 ) /* parity enable */ #define UART_LCRH_PEN (1 << 1) /* parity enable */
#define UART_LCRH_EPS ( 1 << 2 ) /* even parity select */ #define UART_LCRH_EPS (1 << 2) /* even parity select */
#define UART_LCRH_STP1 ( 0 << 3 ) /* one stop bits select */ #define UART_LCRH_STP1 (0 << 3) /* one stop bits select */
#define UART_LCRH_STP2 ( 1 << 3 ) /* two stop bits select */ #define UART_LCRH_STP2 (1 << 3) /* two stop bits select */
#define UART_LCRH_FEN ( 1 << 4 ) /* FIFO enable */ #define UART_LCRH_FEN (1 << 4) /* FIFO enable */
#define UART_LCRH_WLEN5 ( 0 << 5 ) #define UART_LCRH_WLEN5 (0 << 5)
#define UART_LCRH_WLEN6 ( 1 << 5 ) #define UART_LCRH_WLEN6 (1 << 5)
#define UART_LCRH_WLEN7 ( 2 << 5 ) #define UART_LCRH_WLEN7 (2 << 5)
#define UART_LCRH_WLEN8 ( 3 << 5 ) #define UART_LCRH_WLEN8 (3 << 5)
/* Control register bits */ /* Control register bits */
#define UART_CTRL_EN ( 1 << 0 ) #define UART_CTRL_EN (1 << 0)
/* Flag register bits */ /* Flag register bits */
#define UART_FLAG_CTS ( 1 << 0 ) #define UART_FLAG_CTS (1 << 0)
#define UART_FLAG_DSR ( 1 << 1 ) #define UART_FLAG_DSR (1 << 1)
#define UART_FLAG_DCD ( 1 << 2 ) #define UART_FLAG_DCD (1 << 2)
#define UART_FLAG_BUSY ( 1 << 3 ) #define UART_FLAG_BUSY (1 << 3)
#define UART_FLAG_RXFE ( 1 << 4 ) #define UART_FLAG_RXFE (1 << 4)
#define UART_FLAG_TXFF ( 1 << 5 ) #define UART_FLAG_TXFF (1 << 5)
#define UART_FLAG_RXFF ( 1 << 6 ) #define UART_FLAG_RXFF (1 << 6)
#define UART_FLAG_TXFE ( 1 << 7 ) #define UART_FLAG_TXFE (1 << 7)
#endif /* _MACH_ADM5120_UART_H */ #endif /* _MACH_ADM5120_UART_H */

@ -21,12 +21,12 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/delay.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/pci_ids.h> #include <linux/pci_ids.h>
#include <linux/pci_regs.h> #include <linux/pci_regs.h>
#include <asm/delay.h>
#include <asm/bootinfo.h> #include <asm/bootinfo.h>
#include <asm/mach-adm5120/adm5120_defs.h> #include <asm/mach-adm5120/adm5120_defs.h>
@ -71,8 +71,8 @@ static inline u32 read_cfgdata(void)
static inline u32 mkaddr(struct pci_bus *bus, unsigned int devfn, int where) static inline u32 mkaddr(struct pci_bus *bus, unsigned int devfn, int where)
{ {
return (((bus->number & 0xFF) << 16) | ((devfn & 0xFF) << 8) | \ return ((bus->number & 0xFF) << 16) | ((devfn & 0xFF) << 8) | \
(where & 0xFC)); (where & 0xFC);
} }
/* -------------------------------------------------------------------------*/ /* -------------------------------------------------------------------------*/

@ -31,7 +31,7 @@ struct port_state {
unsigned int value; unsigned int value;
}; };
#define PORT_STATE(n,v) {.name = (n), .value = (v)} #define PORT_STATE(n, v) {.name = (n), .value = (v)}
static struct port_state port_states[] = { static struct port_state port_states[] = {
PORT_STATE("off", LED_OFF), PORT_STATE("off", LED_OFF),

@ -89,7 +89,7 @@ static struct flash_desc flash_descs[2] = {
} }
}; };
static const char *probe_types[] = { static const char const *probe_types[] = {
"cfi_probe", "cfi_probe",
"jedec_probe", "jedec_probe",
"map_rom", "map_rom",
@ -97,7 +97,7 @@ static const char *probe_types[] = {
}; };
#ifdef CONFIG_MTD_PARTITIONS #ifdef CONFIG_MTD_PARTITIONS
static const char *parse_types[] = { static const char const *parse_types[] = {
"cmdlinepart", "cmdlinepart",
#ifdef CONFIG_MTD_REDBOOT_PARTS #ifdef CONFIG_MTD_REDBOOT_PARTS
"RedBoot", "RedBoot",

@ -28,7 +28,7 @@
#define TRX_NO_HEADER 0x1 /* do not write TRX header */ #define TRX_NO_HEADER 0x1 /* do not write TRX header */
#define TRX_GZ_FILES 0x2 /* contains individual gzip files */ #define TRX_GZ_FILES 0x2 /* contains individual gzip files */
#define TRX_MAX_OFFSET 3 #define TRX_MAX_OFFSET 3
#define TRX_MIN_KERNEL_SIZE 256*1024 #define TRX_MIN_KERNEL_SIZE (256 * 1024)
struct trx_header { struct trx_header {
u32 magic; /* "HDR0" */ u32 magic; /* "HDR0" */

@ -64,7 +64,7 @@
#define TX_RING_SIZE 32 #define TX_RING_SIZE 32
#define TX_QUEUE_LEN 28 /* Limit ring entries actually used. */ #define TX_QUEUE_LEN 28 /* Limit ring entries actually used. */
#define TX_TIMEOUT HZ*400 #define TX_TIMEOUT (HZ * 400)
#define RX_DESCS_SIZE (RX_RING_SIZE * sizeof(struct dma_desc *)) #define RX_DESCS_SIZE (RX_RING_SIZE * sizeof(struct dma_desc *))
#define RX_SKBS_SIZE (RX_RING_SIZE * sizeof(struct sk_buff *)) #define RX_SKBS_SIZE (RX_RING_SIZE * sizeof(struct sk_buff *))
@ -232,7 +232,7 @@ static void sw_dump_desc(char *label, struct dma_desc *desc, int tx)
t = desc->buf2; t = desc->buf2;
SW_DBG(" buf2 %08X addr=%08X%s\n", desc->buf2, SW_DBG(" buf2 %08X addr=%08X%s\n", desc->buf2,
t & DESC_ADDR_MASK, t & DESC_ADDR_MASK,
(t & DESC_BUF2_EN) ? " EN" : "" ); (t & DESC_BUF2_EN) ? " EN" : "");
t = desc->misc; t = desc->misc;
if (tx) if (tx)
@ -553,13 +553,11 @@ static irqreturn_t adm5120_switch_irq(int irq, void *dev_id)
#else #else
sw_int_ack(status); sw_int_ack(status);
if (status & (SWITCH_INT_RLD | SWITCH_INT_LDF)) { if (status & (SWITCH_INT_RLD | SWITCH_INT_LDF))
adm5120_switch_rx(RX_RING_SIZE); adm5120_switch_rx(RX_RING_SIZE);
}
if (status & SWITCH_INT_SLD) { if (status & SWITCH_INT_SLD)
adm5120_switch_tx(); adm5120_switch_tx();
}
#endif #endif
return IRQ_HANDLED; return IRQ_HANDLED;
@ -589,7 +587,7 @@ static void adm5120_switch_tx_ring_reset(struct dma_desc *desc,
{ {
memset(desc, 0, num * sizeof(*desc)); memset(desc, 0, num * sizeof(*desc));
desc[num-1].buf1 |= DESC_EOR; desc[num-1].buf1 |= DESC_EOR;
memset(skbl, 0, sizeof(struct skb*)*num); memset(skbl, 0, sizeof(struct skb *) * num);
cur_txl = 0; cur_txl = 0;
dirty_txl = 0; dirty_txl = 0;
@ -608,7 +606,7 @@ static void adm5120_switch_rx_ring_reset(struct dma_desc *desc,
break; break;
} }
skb_reserve(skbl[i], SKB_RESERVE_LEN); skb_reserve(skbl[i], SKB_RESERVE_LEN);
adm5120_rx_dma_update(&desc[i], skbl[i], (num-1==i)); adm5120_rx_dma_update(&desc[i], skbl[i], (num - 1 == i));
} }
cur_rxl = 0; cur_rxl = 0;
@ -721,7 +719,8 @@ static void adm5120_write_mac(struct net_device *dev)
sw_write_reg(SWITCH_REG_MAC_WT0, t); sw_write_reg(SWITCH_REG_MAC_WT0, t);
while (!(sw_read_reg(SWITCH_REG_MAC_WT0) & MAC_WT0_MWD)); while (!(sw_read_reg(SWITCH_REG_MAC_WT0) & MAC_WT0_MWD))
;
} }
static void adm5120_set_vlan(char *matrix) static void adm5120_set_vlan(char *matrix)
@ -735,9 +734,10 @@ static void adm5120_set_vlan(char *matrix)
sw_write_reg(SWITCH_REG_VLAN_G2, val); sw_write_reg(SWITCH_REG_VLAN_G2, val);
/* Now set/update the port vs. device lookup table */ /* Now set/update the port vs. device lookup table */
for (port=0; port<SWITCH_NUM_PORTS; port++) { for (port = 0; port < SWITCH_NUM_PORTS; port++) {
for (vlan_port=0; vlan_port<SWITCH_NUM_PORTS && !(matrix[vlan_port] & (0x00000001 << port)); vlan_port++); for (vlan_port = 0; vlan_port < SWITCH_NUM_PORTS && !(matrix[vlan_port] & (0x00000001 << port)); vlan_port++)
if (vlan_port <SWITCH_NUM_PORTS) ;
if (vlan_port < SWITCH_NUM_PORTS)
adm5120_port[port] = adm5120_devs[vlan_port]; adm5120_port[port] = adm5120_devs[vlan_port];
else else
adm5120_port[port] = NULL; adm5120_port[port] = NULL;
@ -891,7 +891,7 @@ static int adm5120_if_hard_start_xmit(struct sk_buff *skb,
data |= DESC_ADDR(skb->data); data |= DESC_ADDR(skb->data);
desc->misc = desc->misc =
((skb->len<ETH_ZLEN?ETH_ZLEN:skb->len) << DESC_PKTLEN_SHIFT) | ((skb->len < ETH_ZLEN ? ETH_ZLEN : skb->len) << DESC_PKTLEN_SHIFT) |
(0x1 << priv->vlan_no); (0x1 << priv->vlan_no);
desc->buflen = skb->len < ETH_ZLEN ? ETH_ZLEN : skb->len; desc->buflen = skb->len < ETH_ZLEN ? ETH_ZLEN : skb->len;
@ -917,7 +917,7 @@ static int adm5120_if_hard_start_xmit(struct sk_buff *skb,
static void adm5120_if_tx_timeout(struct net_device *dev) static void adm5120_if_tx_timeout(struct net_device *dev)
{ {
SW_INFO("TX timeout on %s\n",dev->name); SW_INFO("TX timeout on %s\n", dev->name);
} }
static void adm5120_if_set_multicast_list(struct net_device *dev) static void adm5120_if_set_multicast_list(struct net_device *dev)
@ -990,7 +990,7 @@ static int adm5120_if_do_ioctl(struct net_device *dev, struct ifreq *rq,
struct adm5120_sw_info info; struct adm5120_sw_info info;
struct adm5120_if_priv *priv = netdev_priv(dev); struct adm5120_if_priv *priv = netdev_priv(dev);
switch(cmd) { switch (cmd) {
case SIOCGADMINFO: case SIOCGADMINFO:
info.magic = 0x5120; info.magic = 0x5120;
info.ports = adm5120_nrdevs; info.ports = adm5120_nrdevs;

@ -11,8 +11,8 @@
#define _INCLUDE_ADM5120SW_H_ #define _INCLUDE_ADM5120SW_H_
#define SIOCSMATRIX SIOCDEVPRIVATE #define SIOCSMATRIX SIOCDEVPRIVATE
#define SIOCGMATRIX SIOCDEVPRIVATE+1 #define SIOCGMATRIX (SIOCDEVPRIVATE + 1)
#define SIOCGADMINFO SIOCDEVPRIVATE+2 #define SIOCGADMINFO (SIOCDEVPRIVATE + 2)
struct adm5120_sw_info { struct adm5120_sw_info {
u16 magic; u16 magic;

@ -98,9 +98,9 @@ urb_print(struct admhcd *ahcd, struct urb *urb, char *str, int small, int status
"stat=%d\n", "stat=%d\n",
str, str,
urb, urb,
usb_pipedevice (pipe), usb_pipedevice(pipe),
usb_pipeendpoint (pipe), usb_pipeendpoint(pipe),
usb_pipeout(pipe)? "out" : "in", usb_pipeout(pipe) ? "out" : "in",
pipestring(pipe), pipestring(pipe),
urb->transfer_flags, urb->transfer_flags,
urb->actual_length, urb->actual_length,
@ -114,18 +114,18 @@ urb_print(struct admhcd *ahcd, struct urb *urb, char *str, int small, int status
if (usb_pipecontrol(pipe)) { if (usb_pipecontrol(pipe)) {
admhc_dbg(ahcd, "setup(8):"); admhc_dbg(ahcd, "setup(8):");
for (i = 0; i < 8 ; i++) for (i = 0; i < 8 ; i++)
printk (" %02x", ((__u8 *) urb->setup_packet) [i]); printk(KERN_INFO" %02x", ((__u8 *)urb->setup_packet)[i]);
printk ("\n"); printk(KERN_INFO "\n");
} }
if (urb->transfer_buffer_length > 0 && urb->transfer_buffer) { if (urb->transfer_buffer_length > 0 && urb->transfer_buffer) {
admhc_dbg(ahcd, "data(%d/%d):", admhc_dbg(ahcd, "data(%d/%d):",
urb->actual_length, urb->actual_length,
urb->transfer_buffer_length); urb->transfer_buffer_length);
len = usb_pipeout(pipe)? len = usb_pipeout(pipe) ?
urb->transfer_buffer_length: urb->actual_length; urb->transfer_buffer_length : urb->actual_length;
for (i = 0; i < 16 && i < len; i++) for (i = 0; i < 16 && i < len; i++)
printk(" %02x", ((__u8 *)urb->transfer_buffer)[i]); printk(KERN_INFO " %02x", ((__u8 *)urb->transfer_buffer)[i]);
printk("%s stat:%d\n", i < len? "...": "", status); printk(KERN_INFO "%s stat:%d\n", i < len ? "..." : "", status);
} }
} }
#endif /* ADMHC_VERBOSE_DEBUG */ #endif /* ADMHC_VERBOSE_DEBUG */
@ -135,10 +135,10 @@ urb_print(struct admhcd *ahcd, struct urb *urb, char *str, int small, int status
do { \ do { \
if (next) { \ if (next) { \
unsigned s_len; \ unsigned s_len; \
s_len = scnprintf(*next, *size, format, ## arg ); \ s_len = scnprintf(*next, *size, format, ## arg); \
*size -= s_len; *next += s_len; \ *size -= s_len; *next += s_len; \
} else \ } else \
admhc_dbg(ahcd,format, ## arg ); \ admhc_dbg(ahcd, format, ## arg); \
} while (0); } while (0);
@ -170,7 +170,7 @@ static void maybe_print_eds(struct admhcd *ahcd, char *label, u32 value,
admhc_dbg_sw(ahcd, next, size, "%s %08x\n", label, value); admhc_dbg_sw(ahcd, next, size, "%s %08x\n", label, value);
} }
static char *buss2string (int state) static char *buss2string(int state)
{ {
switch (state) { switch (state) {
case ADMHC_BUSS_RESET: case ADMHC_BUSS_RESET:
@ -220,7 +220,7 @@ admhc_dump_status(struct admhcd *ahcd, char **next, unsigned *size)
admhc_readl(ahcd, &regs->hosthead), next, size); admhc_readl(ahcd, &regs->hosthead), next, size);
} }
#define dbg_port_sw(hc,num,value,next,size) \ #define dbg_port_sw(hc, num, value, next, size) \
admhc_dbg_sw(hc, next, size, \ admhc_dbg_sw(hc, next, size, \
"portstatus [%d] " \ "portstatus [%d] " \
"0x%08x%s%s%s%s%s%s%s%s%s%s%s%s\n", \ "0x%08x%s%s%s%s%s%s%s%s%s%s%s%s\n", \
@ -286,7 +286,7 @@ static void admhc_dump(struct admhcd *ahcd, int verbose)
/* dumps some of the state we know about */ /* dumps some of the state we know about */
admhc_dump_status(ahcd, NULL, NULL); admhc_dump_status(ahcd, NULL, NULL);
admhc_dbg(ahcd,"current frame #%04x\n", admhc_dbg(ahcd, "current frame #%04x\n",
admhc_frame_no(ahcd)); admhc_frame_no(ahcd));
admhc_dump_roothub(ahcd, verbose, NULL, NULL); admhc_dump_roothub(ahcd, verbose, NULL, NULL);
@ -348,7 +348,7 @@ admhc_dump_ed(const struct admhcd *ahcd, const char *label,
tmp = hc32_to_cpup(ahcd, &ed->hwHeadP); tmp = hc32_to_cpup(ahcd, &ed->hwHeadP);
admhc_dbg(ahcd, " tds: head %08x tail %08x %s%s%s\n", admhc_dbg(ahcd, " tds: head %08x tail %08x %s%s%s\n",
tmp & TD_MASK, tmp & TD_MASK,
hc32_to_cpup (ahcd, &ed->hwTailP), hc32_to_cpup(ahcd, &ed->hwTailP),
(tmp & ED_C) ? data1 : data0, (tmp & ED_C) ? data1 : data0,
(tmp & ED_H) ? " HALT" : "", (tmp & ED_H) ? " HALT" : "",
verbose ? " td list follows" : " (not listing)"); verbose ? " td list follows" : " (not listing)");
@ -362,7 +362,7 @@ admhc_dump_ed(const struct admhcd *ahcd, const char *label,
list_for_each(tmp, &ed->td_list) { list_for_each(tmp, &ed->td_list) {
struct td *td; struct td *td;
td = list_entry(tmp, struct td, td_list); td = list_entry(tmp, struct td, td_list);
admhc_dump_td (ahcd, " ->", td); admhc_dump_td(ahcd, " ->", td);
} }
} }
} }
@ -447,7 +447,7 @@ show_list(struct admhcd *ahcd, char *buf, size_t count, struct ed *ed)
" h:%08x t:%08x", " h:%08x t:%08x",
ed, ed,
ed_statestring(ed->state), ed_statestring(ed->state),
ed_typestring (ed->type), ed_typestring(ed->type),
(info & ED_SPEED_FULL) ? 'f' : 'l', (info & ED_SPEED_FULL) ? 'f' : 'l',
info & ED_FA_MASK, info & ED_FA_MASK,
(info >> ED_EN_SHIFT) & ED_EN_MASK, (info >> ED_EN_SHIFT) & ED_EN_MASK,
@ -458,7 +458,7 @@ show_list(struct admhcd *ahcd, char *buf, size_t count, struct ed *ed)
(info & ED_SKIP) ? " S" : "", (info & ED_SKIP) ? " S" : "",
(headp & ED_H) ? " H" : "", (headp & ED_H) ? " H" : "",
(headp & ED_C) ? data1 : data0, (headp & ED_C) ? data1 : data0,
headp & ED_MASK,tailp); headp & ED_MASK, tailp);
size -= temp; size -= temp;
buf += temp; buf += temp;
@ -466,9 +466,9 @@ show_list(struct admhcd *ahcd, char *buf, size_t count, struct ed *ed)
u32 dbp, cbl; u32 dbp, cbl;
td = list_entry(entry, struct td, td_list); td = list_entry(entry, struct td, td_list);
info = hc32_to_cpup (ahcd, &td->hwINFO); info = hc32_to_cpup(ahcd, &td->hwINFO);
dbp = hc32_to_cpup (ahcd, &td->hwDBP); dbp = hc32_to_cpup(ahcd, &td->hwDBP);
cbl = hc32_to_cpup (ahcd, &td->hwCBL); cbl = hc32_to_cpup(ahcd, &td->hwCBL);
temp = scnprintf(buf, size, temp = scnprintf(buf, size,
"\n\ttd/%p %s %d %s%scc=%x urb %p (%08x,%08x)", "\n\ttd/%p %s %d %s%scc=%x urb %p (%08x,%08x)",
@ -477,7 +477,7 @@ show_list(struct admhcd *ahcd, char *buf, size_t count, struct ed *ed)
TD_BL_GET(cbl), TD_BL_GET(cbl),
(info & TD_OWN) ? "" : "DONE ", (info & TD_OWN) ? "" : "DONE ",
(cbl & TD_IE) ? "IE " : "", (cbl & TD_IE) ? "IE " : "",
TD_CC_GET (info), td->urb, info, cbl); TD_CC_GET(info), td->urb, info, cbl);
size -= temp; size -= temp;
buf += temp; buf += temp;
} }
@ -525,7 +525,8 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf)
char *next; char *next;
unsigned i; unsigned i;
if (!(seen = kmalloc(DBG_SCHED_LIMIT * sizeof *seen, GFP_ATOMIC))) seen = kmalloc(DBG_SCHED_LIMIT * sizeof(*seen), GFP_ATOMIC);
if (!seen)
return 0; return 0;
seen_count = 0; seen_count = 0;
@ -542,10 +543,11 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf)
/* dump a snapshot of the periodic schedule (and load) */ /* dump a snapshot of the periodic schedule (and load) */
spin_lock_irqsave(&ahcd->lock, flags); spin_lock_irqsave(&ahcd->lock, flags);
for (i = 0; i < NUM_INTS; i++) { for (i = 0; i < NUM_INTS; i++) {
if (!(ed = ahcd->periodic [i])) ed = ahcd->periodic[i];
if (!ed)
continue; continue;
temp = scnprintf(next, size, "%2d [%3d]:", i, ahcd->load [i]); temp = scnprintf(next, size, "%2d [%3d]:", i, ahcd->load[i]);
size -= temp; size -= temp;
next += temp; next += temp;
@ -555,18 +557,18 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf)
size -= temp; size -= temp;
next += temp; next += temp;
for (temp = 0; temp < seen_count; temp++) { for (temp = 0; temp < seen_count; temp++) {
if (seen [temp] == ed) if (seen[temp] == ed)
break; break;
} }
/* show more info the first time around */ /* show more info the first time around */
if (temp == seen_count) { if (temp == seen_count) {
u32 info = hc32_to_cpu (ahcd, ed->hwINFO); u32 info = hc32_to_cpu(ahcd, ed->hwINFO);
struct list_head *entry; struct list_head *entry;
unsigned qlen = 0; unsigned qlen = 0;
/* qlen measured here in TDs, not urbs */ /* qlen measured here in TDs, not urbs */
list_for_each (entry, &ed->td_list) list_for_each(entry, &ed->td_list)
qlen++; qlen++;
temp = scnprintf(next, size, temp = scnprintf(next, size,
" (%cs dev%d ep%d%s qlen %u" " (%cs dev%d ep%d%s qlen %u"
@ -586,7 +588,7 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf)
next += temp; next += temp;
if (seen_count < DBG_SCHED_LIMIT) if (seen_count < DBG_SCHED_LIMIT)
seen [seen_count++] = ed; seen[seen_count++] = ed;
ed = ed->ed_next; ed = ed->ed_next;
@ -603,7 +605,7 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf)
next += temp; next += temp;
} }
spin_unlock_irqrestore(&ahcd->lock, flags); spin_unlock_irqrestore(&ahcd->lock, flags);
kfree (seen); kfree(seen);
return PAGE_SIZE - size; return PAGE_SIZE - size;
} }

@ -114,7 +114,7 @@ static void admhc_adm5120_remove(struct usb_hcd *hcd,
static int __devinit static int __devinit
admhc_adm5120_start(struct usb_hcd *hcd) admhc_adm5120_start(struct usb_hcd *hcd)
{ {
struct admhcd *ahcd = hcd_to_admhcd (hcd); struct admhcd *ahcd = hcd_to_admhcd(hcd);
int ret; int ret;
ret = admhc_init(ahcd); ret = admhc_init(ahcd);

@ -36,8 +36,8 @@
#include <linux/dmapool.h> #include <linux/dmapool.h>
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/debugfs.h> #include <linux/debugfs.h>
#include <linux/io.h>
#include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
@ -58,12 +58,12 @@
#define OHCI_CONTROL_INIT OHCI_CTRL_CBSR #define OHCI_CONTROL_INIT OHCI_CTRL_CBSR
#define ADMHC_INTR_INIT \ #define ADMHC_INTR_INIT \
( ADMHC_INTR_MIE | ADMHC_INTR_INSM | ADMHC_INTR_FATI \ (ADMHC_INTR_MIE | ADMHC_INTR_INSM | ADMHC_INTR_FATI \
| ADMHC_INTR_RESI | ADMHC_INTR_TDC | ADMHC_INTR_BABI ) | ADMHC_INTR_RESI | ADMHC_INTR_TDC | ADMHC_INTR_BABI)
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
static const char hcd_name [] = "admhc-hcd"; static const char hcd_name[] = "admhc-hcd";
#define STATECHANGE_DELAY msecs_to_jiffies(300) #define STATECHANGE_DELAY msecs_to_jiffies(300)
@ -128,7 +128,7 @@ static int admhc_urb_enqueue(struct usb_hcd *hcd, struct urb *urb,
else if ((urb->transfer_flags & URB_ZERO_PACKET) != 0 else if ((urb->transfer_flags & URB_ZERO_PACKET) != 0
&& (urb->transfer_buffer_length && (urb->transfer_buffer_length
% usb_maxpacket(urb->dev, pipe, % usb_maxpacket(urb->dev, pipe,
usb_pipeout (pipe))) == 0) usb_pipeout(pipe))) == 0)
td_cnt++; td_cnt++;
break; break;
case PIPE_INTERRUPT: case PIPE_INTERRUPT:
@ -302,8 +302,8 @@ sanitize:
goto rescan; goto rescan;
case ED_IDLE: /* fully unlinked */ case ED_IDLE: /* fully unlinked */
if (list_empty(&ed->td_list)) { if (list_empty(&ed->td_list)) {
td_free (ahcd, ed->dummy); td_free(ahcd, ed->dummy);
ed_free (ahcd, ed); ed_free(ahcd, ed);
break; break;
} }
/* else FALL THROUGH */ /* else FALL THROUGH */
@ -340,7 +340,7 @@ static void admhc_usb_reset(struct admhcd *ahcd)
#else #else
/* FIXME */ /* FIXME */
ahcd->host_control = ADMHC_BUSS_RESET; ahcd->host_control = ADMHC_BUSS_RESET;
admhc_writel(ahcd, ahcd->host_control ,&ahcd->regs->host_control); admhc_writel(ahcd, ahcd->host_control, &ahcd->regs->host_control);
#endif #endif
} }
@ -798,7 +798,7 @@ static int __init admhc_hcd_mod_init(void)
pr_info("%s: " DRIVER_INFO "\n", hcd_name); pr_info("%s: " DRIVER_INFO "\n", hcd_name);
pr_info("%s: block sizes: ed %Zd td %Zd\n", hcd_name, pr_info("%s: block sizes: ed %Zd td %Zd\n", hcd_name,
sizeof (struct ed), sizeof (struct td)); sizeof(struct ed), sizeof(struct td));
#ifdef DEBUG #ifdef DEBUG
admhc_debug_root = debugfs_create_dir("admhc", NULL); admhc_debug_root = debugfs_create_dir("admhc", NULL);

@ -19,7 +19,7 @@
* ADM5120 Root Hub ... the nonsharable stuff * ADM5120 Root Hub ... the nonsharable stuff
*/ */
#define dbg_port(hc,label,num,value) \ #define dbg_port(hc, label, num, value) \
admhc_dbg(hc, \ admhc_dbg(hc, \
"%s port%d " \ "%s port%d " \
"= 0x%08x%s%s%s%s%s%s%s%s%s%s%s%s\n", \ "= 0x%08x%s%s%s%s%s%s%s%s%s%s%s%s\n", \
@ -40,7 +40,7 @@
(value & ADMHC_PS_CCS) ? " CCS" : "" \ (value & ADMHC_PS_CCS) ? " CCS" : "" \
); );
#define dbg_port_write(hc,label,num,value) \ #define dbg_port_write(hc, label, num, value) \
admhc_dbg(hc, \ admhc_dbg(hc, \
"%s port%d " \ "%s port%d " \
"= 0x%08x%s%s%s%s%s%s%s%s%s%s%s%s\n", \ "= 0x%08x%s%s%s%s%s%s%s%s%s%s%s%s\n", \
@ -81,11 +81,11 @@ admhc_hub_status_data(struct usb_hcd *hcd, char *buf)
/* init status */ /* init status */
status = admhc_read_rhdesc(ahcd); status = admhc_read_rhdesc(ahcd);
if (status & (ADMHC_RH_LPSC | ADMHC_RH_OCIC)) if (status & (ADMHC_RH_LPSC | ADMHC_RH_OCIC))
buf [0] = changed = 1; buf[0] = changed = 1;
else else
buf [0] = 0; buf[0] = 0;
if (ahcd->num_ports > 7) { if (ahcd->num_ports > 7) {
buf [1] = 0; buf[1] = 0;
length++; length++;
} }
@ -100,9 +100,9 @@ admhc_hub_status_data(struct usb_hcd *hcd, char *buf)
| ADMHC_PS_OCIC | ADMHC_PS_PRSC)) { | ADMHC_PS_OCIC | ADMHC_PS_PRSC)) {
changed = 1; changed = 1;
if (i < 7) if (i < 7)
buf [0] |= 1 << (i + 1); buf[0] |= 1 << (i + 1);
else else
buf [1] |= 1 << (i - 7); buf[1] |= 1 << (i - 7);
} }
} }
@ -247,7 +247,7 @@ static void start_hnp(struct admhcd *ahcd);
#define PORT_RESET_HW_MSEC 10 #define PORT_RESET_HW_MSEC 10
/* wrap-aware logic morphed from <linux/jiffies.h> */ /* wrap-aware logic morphed from <linux/jiffies.h> */
#define tick_before(t1,t2) ((s16)(((s16)(t1))-((s16)(t2))) < 0) #define tick_before(t1, t2) ((s16)(((s16)(t1)) - ((s16)(t2))) < 0)
/* called from some task, normally khubd */ /* called from some task, normally khubd */
static inline int admhc_port_reset(struct admhcd *ahcd, unsigned port) static inline int admhc_port_reset(struct admhcd *ahcd, unsigned port)

@ -125,10 +125,10 @@ static void td_free(struct admhcd *ahcd, struct td *td)
#if 0 #if 0
/* TODO: remove */ /* TODO: remove */
else if ((td->hwINFO & cpu_to_hc32(ahcd, TD_DONE)) != 0) else if ((td->hwINFO & cpu_to_hc32(ahcd, TD_DONE)) != 0)
admhc_dbg (ahcd, "no hash for td %p\n", td); admhc_dbg(ahcd, "no hash for td %p\n", td);
#else #else
else if ((td->flags & TD_FLAG_DONE) != 0) else if ((td->flags & TD_FLAG_DONE) != 0)
admhc_dbg (ahcd, "no hash for td %p\n", td); admhc_dbg(ahcd, "no hash for td %p\n", td);
#endif #endif
dma_pool_free(ahcd->td_cache, td, td->td_dma); dma_pool_free(ahcd->td_cache, td, td->td_dma);
} }

@ -42,7 +42,7 @@ __acquires(ahcd->lock)
} }
#ifdef ADMHC_VERBOSE_DEBUG #ifdef ADMHC_VERBOSE_DEBUG
urb_print(ahcd, urb, "RET", usb_pipeout (urb->pipe), status); urb_print(ahcd, urb, "RET", usb_pipeout(urb->pipe), status);
#endif #endif
/* urb->complete() can reenter this HCD */ /* urb->complete() can reenter this HCD */
@ -73,12 +73,12 @@ static int balance(struct admhcd *ahcd, int interval, int load)
* that has enough bandwidth left unreserved. * that has enough bandwidth left unreserved.
*/ */
for (i = 0; i < interval ; i++) { for (i = 0; i < interval ; i++) {
if (branch < 0 || ahcd->load [branch] > ahcd->load [i]) { if (branch < 0 || ahcd->load[branch] > ahcd->load[i]) {
int j; int j;
/* usb 1.1 says 90% of one frame */ /* usb 1.1 says 90% of one frame */
for (j = i; j < NUM_INTS; j += interval) { for (j = i; j < NUM_INTS; j += interval) {
if ((ahcd->load [j] + load) > 900) if ((ahcd->load[j] + load) > 900)
break; break;
} }
if (j < NUM_INTS) if (j < NUM_INTS)
@ -97,17 +97,17 @@ static int balance(struct admhcd *ahcd, int interval, int load)
* into the schedule tree in the apppropriate place. most iso devices use * into the schedule tree in the apppropriate place. most iso devices use
* 1msec periods, but that's not required. * 1msec periods, but that's not required.
*/ */
static void periodic_link (struct admhcd *ahcd, struct ed *ed) static void periodic_link(struct admhcd *ahcd, struct ed *ed)
{ {
unsigned i; unsigned i;
admhc_vdbg (ahcd, "link %sed %p branch %d [%dus.], interval %d\n", admhc_vdbg(ahcd, "link %sed %p branch %d [%dus.], interval %d\n",
(ed->hwINFO & cpu_to_hc32(ahcd, ED_ISO)) ? "iso " : "", (ed->hwINFO & cpu_to_hc32(ahcd, ED_ISO)) ? "iso " : "",
ed, ed->branch, ed->load, ed->interval); ed, ed->branch, ed->load, ed->interval);
for (i = ed->branch; i < NUM_INTS; i += ed->interval) { for (i = ed->branch; i < NUM_INTS; i += ed->interval) {
struct ed **prev = &ahcd->periodic [i]; struct ed **prev = &ahcd->periodic[i];
__hc32 *prev_p = &ahcd->hcca->int_table [i]; __hc32 *prev_p = &ahcd->hcca->int_table[i];
struct ed *here = *prev; struct ed *here = *prev;
/* sorting each branch by period (slow before fast) /* sorting each branch by period (slow before fast)
@ -125,12 +125,12 @@ static void periodic_link (struct admhcd *ahcd, struct ed *ed)
ed->ed_next = here; ed->ed_next = here;
if (here) if (here)
ed->hwNextED = *prev_p; ed->hwNextED = *prev_p;
wmb (); wmb();
*prev = ed; *prev = ed;
*prev_p = cpu_to_hc32(ahcd, ed->dma); *prev_p = cpu_to_hc32(ahcd, ed->dma);
wmb(); wmb();
} }
ahcd->load [i] += ed->load; ahcd->load[i] += ed->load;
} }
admhcd_to_hcd(ahcd)->self.bandwidth_allocated += ed->load / ed->interval; admhcd_to_hcd(ahcd)->self.bandwidth_allocated += ed->load / ed->interval;
} }
@ -170,14 +170,14 @@ static int ed_schedule(struct admhcd *ahcd, struct ed *ed)
#if 0 /* FIXME */ #if 0 /* FIXME */
/* scan the periodic table to find and unlink this ED */ /* scan the periodic table to find and unlink this ED */
static void periodic_unlink (struct admhcd *ahcd, struct ed *ed) static void periodic_unlink(struct admhcd *ahcd, struct ed *ed)
{ {
int i; int i;
for (i = ed->branch; i < NUM_INTS; i += ed->interval) { for (i = ed->branch; i < NUM_INTS; i += ed->interval) {
struct ed *temp; struct ed *temp;
struct ed **prev = &ahcd->periodic [i]; struct ed **prev = &ahcd->periodic[i];
__hc32 *prev_p = &ahcd->hcca->int_table [i]; __hc32 *prev_p = &ahcd->hcca->int_table[i];
while (*prev && (temp = *prev) != ed) { while (*prev && (temp = *prev) != ed) {
prev_p = &temp->hwNextED; prev_p = &temp->hwNextED;
@ -187,11 +187,11 @@ static void periodic_unlink (struct admhcd *ahcd, struct ed *ed)
*prev_p = ed->hwNextED; *prev_p = ed->hwNextED;
*prev = ed->ed_next; *prev = ed->ed_next;
} }
ahcd->load [i] -= ed->load; ahcd->load[i] -= ed->load;
} }
admhcd_to_hcd(ahcd)->self.bandwidth_allocated -= ed->load / ed->interval; admhcd_to_hcd(ahcd)->self.bandwidth_allocated -= ed->load / ed->interval;
admhc_vdbg (ahcd, "unlink %sed %p branch %d [%dus.], interval %d\n", admhc_vdbg(ahcd, "unlink %sed %p branch %d [%dus.], interval %d\n",
(ed->hwINFO & cpu_to_hc32(ahcd, ED_ISO)) ? "iso " : "", (ed->hwINFO & cpu_to_hc32(ahcd, ED_ISO)) ? "iso " : "",
ed, ed->branch, ed->load, ed->interval); ed, ed->branch, ed->load, ed->interval);
} }
@ -596,7 +596,7 @@ static int td_done(struct admhcd *ahcd, struct urb *urb, struct td *td)
urb->iso_frame_desc[td->index].status = cc_to_error[cc]; urb->iso_frame_desc[td->index].status = cc_to_error[cc];
if (cc != TD_CC_NOERROR) if (cc != TD_CC_NOERROR)
admhc_vdbg (ahcd, admhc_vdbg(ahcd,
"urb %p iso td %p (%d) len %d cc %d\n", "urb %p iso td %p (%d) len %d cc %d\n",
urb, td, 1 + td->index, dlen, cc); urb, td, 1 + td->index, dlen, cc);
@ -615,9 +615,8 @@ static int td_done(struct admhcd *ahcd, struct urb *urb, struct td *td)
/* count all non-empty packets except control SETUP packet */ /* count all non-empty packets except control SETUP packet */
if ((type != PIPE_CONTROL || td->index != 0) && tdDBP != 0) { if ((type != PIPE_CONTROL || td->index != 0) && tdDBP != 0)
urb->actual_length += tdDBP - td->data_dma + bl; urb->actual_length += tdDBP - td->data_dma + bl;
}
if (cc != TD_CC_NOERROR && cc < TD_CC_HCD0) if (cc != TD_CC_NOERROR && cc < TD_CC_HCD0)
admhc_vdbg(ahcd, admhc_vdbg(ahcd,
@ -691,13 +690,13 @@ ed_halted(struct admhcd *ahcd, struct td *td, int cc, struct td *rev)
break; break;
/* fallthrough */ /* fallthrough */
default: default:
admhc_dbg (ahcd, admhc_dbg(ahcd,
"urb %p path %s ep%d%s %08x cc %d --> status %d\n", "urb %p path %s ep%d%s %08x cc %d --> status %d\n",
urb, urb->dev->devpath, urb, urb->dev->devpath,
usb_pipeendpoint (urb->pipe), usb_pipeendpoint (urb->pipe),
usb_pipein (urb->pipe) ? "in" : "out", usb_pipein(urb->pipe) ? "in" : "out",
hc32_to_cpu(ahcd, td->hwINFO), hc32_to_cpu(ahcd, td->hwINFO),
cc, cc_to_error [cc]); cc, cc_to_error[cc]);
} }
} }
@ -719,11 +718,10 @@ rescan_all:
* frame counter wraps and EDs with partially retired TDs * frame counter wraps and EDs with partially retired TDs
*/ */
if (likely(HC_IS_RUNNING(admhcd_to_hcd(ahcd)->state))) { if (likely(HC_IS_RUNNING(admhcd_to_hcd(ahcd)->state))) {
if (tick_before (tick, ed->tick)) { if (tick_before(tick, ed->tick))
skip_ed: skip_ed:
last = &ed->ed_rm_next; last = &ed->ed_rm_next;
continue; continue;
}
#if 0 #if 0
if (!list_empty(&ed->td_list)) { if (!list_empty(&ed->td_list)) {
struct td *td; struct td *td;
@ -828,7 +826,7 @@ rescan_this:
static void ed_unhalt(struct admhcd *ahcd, struct ed *ed, struct urb *urb) static void ed_unhalt(struct admhcd *ahcd, struct ed *ed, struct urb *urb)
{ {
struct list_head *entry,*tmp; struct list_head *entry, *tmp;
__hc32 toggle = ed->hwHeadP & cpu_to_hc32(ahcd, ED_C); __hc32 toggle = ed->hwHeadP & cpu_to_hc32(ahcd, ED_C);
#ifdef ADMHC_VERBOSE_DEBUG #ifdef ADMHC_VERBOSE_DEBUG
@ -880,7 +878,7 @@ static inline int is_td_halted(struct admhcd *ahcd, struct ed *ed,
static void ed_update(struct admhcd *ahcd, struct ed *ed) static void ed_update(struct admhcd *ahcd, struct ed *ed)
{ {
struct list_head *entry,*tmp; struct list_head *entry, *tmp;
#ifdef ADMHC_VERBOSE_DEBUG #ifdef ADMHC_VERBOSE_DEBUG
admhc_dump_ed(ahcd, "UPDATE", ed, 1); admhc_dump_ed(ahcd, "UPDATE", ed, 1);
@ -901,7 +899,7 @@ static void ed_update(struct admhcd *ahcd, struct ed *ed)
ed_unhalt(ahcd, ed, urb); ed_unhalt(ahcd, ed, urb);
if (ed->type == PIPE_INTERRUPT) if (ed->type == PIPE_INTERRUPT)
ed_intr_refill(ahcd,ed); ed_intr_refill(ahcd, ed);
/* If all this urb's TDs are done, call complete() */ /* If all this urb's TDs are done, call complete() */
if (urb_priv->td_idx == urb_priv->td_cnt) if (urb_priv->td_idx == urb_priv->td_cnt)
@ -923,11 +921,11 @@ static void ed_update(struct admhcd *ahcd, struct ed *ed)
/* ... hc may need waking-up */ /* ... hc may need waking-up */
switch (ed->type) { switch (ed->type) {
case PIPE_CONTROL: case PIPE_CONTROL:
admhc_writel (ahcd, OHCI_CLF, admhc_writel(ahcd, OHCI_CLF,
&ahcd->regs->cmdstatus); &ahcd->regs->cmdstatus);
break; break;
case PIPE_BULK: case PIPE_BULK:
admhc_writel (ahcd, OHCI_BLF, admhc_writel(ahcd, OHCI_BLF,
&ahcd->regs->cmdstatus); &ahcd->regs->cmdstatus);
break; break;
} }

@ -187,7 +187,7 @@ struct td {
/* map OHCI TD status codes (CC) to errno values */ /* map OHCI TD status codes (CC) to errno values */
static const int cc_to_error [16] = { static const int cc_to_error[16] = {
/* No Error */ 0, /* No Error */ 0,
/* CRC Error */ -EILSEQ, /* CRC Error */ -EILSEQ,
/* Bit Stuff */ -EPROTO, /* Bit Stuff */ -EPROTO,
@ -430,7 +430,7 @@ struct admhcd {
#define OHCI_QUIRK_BE_DESC 0x08 /* BE descriptors */ #define OHCI_QUIRK_BE_DESC 0x08 /* BE descriptors */
#define OHCI_QUIRK_BE_MMIO 0x10 /* BE registers */ #define OHCI_QUIRK_BE_MMIO 0x10 /* BE registers */
#define OHCI_QUIRK_ZFMICRO 0x20 /* Compaq ZFMicro chipset*/ #define OHCI_QUIRK_ZFMICRO 0x20 /* Compaq ZFMicro chipset*/
// there are also chip quirks/bugs in init logic /* there are also chip quirks/bugs in init logic */
#ifdef DEBUG #ifdef DEBUG
struct dentry *debug_dir; struct dentry *debug_dir;
@ -458,17 +458,17 @@ static inline struct usb_hcd *admhcd_to_hcd(const struct admhcd *ahcd)
#ifdef DEBUG #ifdef DEBUG
# define admhc_dbg(ahcd, fmt, args...) \ # define admhc_dbg(ahcd, fmt, args...) \
printk(KERN_DEBUG "adm5120-hcd: " fmt , ## args ) printk(KERN_DEBUG "adm5120-hcd: " fmt, ## args)
#else #else
# define admhc_dbg(ahcd, fmt, args...) do { } while (0) # define admhc_dbg(ahcd, fmt, args...) do { } while (0)
#endif #endif
#define admhc_err(ahcd, fmt, args...) \ #define admhc_err(ahcd, fmt, args...) \
printk(KERN_ERR "adm5120-hcd: " fmt , ## args ) printk(KERN_ERR "adm5120-hcd: " fmt, ## args)
#define admhc_info(ahcd, fmt, args...) \ #define admhc_info(ahcd, fmt, args...) \
printk(KERN_INFO "adm5120-hcd: " fmt , ## args ) printk(KERN_INFO "adm5120-hcd: " fmt, ## args)
#define admhc_warn(ahcd, fmt, args...) \ #define admhc_warn(ahcd, fmt, args...) \
printk(KERN_WARNING "adm5120-hcd: " fmt , ## args ) printk(KERN_WARNING "adm5120-hcd: " fmt, ## args)
#ifdef ADMHC_VERBOSE_DEBUG #ifdef ADMHC_VERBOSE_DEBUG
# define admhc_vdbg admhc_dbg # define admhc_vdbg admhc_dbg
@ -745,7 +745,7 @@ static inline void admhc_dma_enable(struct admhcd *ahcd)
t |= ADMHC_HC_DMAE; t |= ADMHC_HC_DMAE;
admhc_writel(ahcd, t, &ahcd->regs->host_control); admhc_writel(ahcd, t, &ahcd->regs->host_control);
admhc_vdbg(ahcd,"DMA enabled\n"); admhc_vdbg(ahcd, "DMA enabled\n");
} }
static inline void admhc_dma_disable(struct admhcd *ahcd) static inline void admhc_dma_disable(struct admhcd *ahcd)
@ -758,5 +758,5 @@ static inline void admhc_dma_disable(struct admhcd *ahcd)
t &= ~ADMHC_HC_DMAE; t &= ~ADMHC_HC_DMAE;
admhc_writel(ahcd, t, &ahcd->regs->host_control); admhc_writel(ahcd, t, &ahcd->regs->host_control);
admhc_vdbg(ahcd,"DMA disabled\n"); admhc_vdbg(ahcd, "DMA disabled\n");
} }

@ -32,8 +32,8 @@
#define NAME "adm5120_wdt" #define NAME "adm5120_wdt"
#define VERSION "0.1" #define VERSION "0.1"
static int expect_close = 0; static int expect_close;
static int access = 0; static int access;
static unsigned int timeout = DEFAULT_TIMEOUT; static unsigned int timeout = DEFAULT_TIMEOUT;
static int nowayout = WATCHDOG_NOWAYOUT; static int nowayout = WATCHDOG_NOWAYOUT;
@ -71,9 +71,8 @@ static int wdt_open(struct inode *inode, struct file *file)
if (access) if (access)
return -EBUSY; return -EBUSY;
if (nowayout) { if (nowayout)
__module_get(THIS_MODULE); __module_get(THIS_MODULE);
}
/* Activate timer */ /* Activate timer */
wdt_reset_counter(); wdt_reset_counter();
@ -93,9 +92,9 @@ static int wdt_release(struct inode *inode, struct file *file)
wdt_disable(); wdt_disable();
printk(KERN_INFO NAME ": disabling watchdog timer\n"); printk(KERN_INFO NAME ": disabling watchdog timer\n");
module_put(THIS_MODULE); module_put(THIS_MODULE);
} else { } else
printk(KERN_CRIT NAME ": device closed unexpectedly. WDT will not stop!\n"); printk(KERN_CRIT NAME ": device closed unexpectedly. WDT will not stop!\n");
}
access = 0; access = 0;
return 0; return 0;
} }
@ -139,12 +138,12 @@ static int wdt_ioctl(struct inode *inode, struct file *file,
default: default:
return -ENOTTY; return -ENOTTY;
case WDIOC_GETSUPPORT: case WDIOC_GETSUPPORT:
if(copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident))) if (copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident)))
return -EFAULT; return -EFAULT;
return 0; return 0;
case WDIOC_GETSTATUS: case WDIOC_GETSTATUS:
case WDIOC_GETBOOTSTATUS: case WDIOC_GETBOOTSTATUS:
return put_user(0,(int *)arg); return put_user(0, (int *)arg);
case WDIOC_KEEPALIVE: case WDIOC_KEEPALIVE:
wdt_reset_counter(); wdt_reset_counter();
return 0; return 0;
@ -163,19 +162,19 @@ static int wdt_ioctl(struct inode *inode, struct file *file,
} }
} }
static struct file_operations wdt_fops = { static const struct file_operations wdt_fops = {
owner: THIS_MODULE, .owner = THIS_MODULE,
llseek: no_llseek, .llseek = no_llseek,
write: wdt_write, .write = wdt_write,
ioctl: wdt_ioctl, .ioctl = wdt_ioctl,
open: wdt_open, .open = wdt_open,
release: wdt_release, .release = wdt_release,
}; };
static struct miscdevice wdt_miscdev = { static struct miscdevice wdt_miscdev = {
minor: WATCHDOG_MINOR, .minor = WATCHDOG_MINOR,
name: "watchdog", .name = "watchdog",
fops: &wdt_fops, .fops = &wdt_fops,
}; };
static char banner[] __initdata = KERN_INFO NAME ": Watchdog Timer version " VERSION "\n"; static char banner[] __initdata = KERN_INFO NAME ": Watchdog Timer version " VERSION "\n";

@ -1,6 +1,6 @@
--- a/drivers/net/Kconfig --- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig +++ b/drivers/net/Kconfig
@@ -602,6 +602,10 @@ config MIPS_AU1X00_ENET @@ -479,6 +479,10 @@ config MIPS_AU1X00_ENET
If you have an Alchemy Semi AU1X00 based system If you have an Alchemy Semi AU1X00 based system
say Y. Otherwise, say N. say Y. Otherwise, say N.
@ -13,7 +13,7 @@
depends on PCI && SGI_IP27 depends on PCI && SGI_IP27
--- a/drivers/net/Makefile --- a/drivers/net/Makefile
+++ b/drivers/net/Makefile +++ b/drivers/net/Makefile
@@ -208,6 +208,7 @@ obj-$(CONFIG_SC92031) += sc92031.o @@ -207,6 +207,7 @@ obj-$(CONFIG_SC92031) += sc92031.o
# This is also a 82596 and should probably be merged # This is also a 82596 and should probably be merged
obj-$(CONFIG_LP486E) += lp486e.o obj-$(CONFIG_LP486E) += lp486e.o

@ -7,5 +7,5 @@
- if (next) { \ - if (next) { \
+ if (next != NULL) { \ + if (next != NULL) { \
unsigned s_len; \ unsigned s_len; \
s_len = scnprintf(*next, *size, format, ## arg ); \ s_len = scnprintf(*next, *size, format, ## arg); \
*size -= s_len; *next += s_len; \ *size -= s_len; *next += s_len; \

@ -1,6 +1,6 @@
--- a/drivers/usb/host/adm5120-dbg.c --- a/drivers/usb/host/adm5120-dbg.c
+++ b/drivers/usb/host/adm5120-dbg.c +++ b/drivers/usb/host/adm5120-dbg.c
@@ -642,7 +642,7 @@ static ssize_t fill_registers_buffer(str @@ -644,7 +644,7 @@ static ssize_t fill_registers_buffer(str
hcd->product_desc, hcd->product_desc,
hcd_name); hcd_name);

@ -35,7 +35,7 @@
struct admhcd *ahcd; struct admhcd *ahcd;
struct ed **seen, *ed; struct ed **seen, *ed;
unsigned long flags; unsigned long flags;
@@ -529,9 +523,7 @@ static ssize_t fill_periodic_buffer(stru @@ -530,9 +524,7 @@ static ssize_t fill_periodic_buffer(stru
return 0; return 0;
seen_count = 0; seen_count = 0;
@ -46,7 +46,7 @@
next = buf->page; next = buf->page;
size = PAGE_SIZE; size = PAGE_SIZE;
@@ -613,7 +605,6 @@ static ssize_t fill_periodic_buffer(stru @@ -615,7 +607,6 @@ static ssize_t fill_periodic_buffer(stru
static ssize_t fill_registers_buffer(struct debug_buffer *buf) static ssize_t fill_registers_buffer(struct debug_buffer *buf)
{ {
@ -54,7 +54,7 @@
struct usb_hcd *hcd; struct usb_hcd *hcd;
struct admhcd *ahcd; struct admhcd *ahcd;
struct admhcd_regs __iomem *regs; struct admhcd_regs __iomem *regs;
@@ -622,9 +613,8 @@ static ssize_t fill_registers_buffer(str @@ -624,9 +615,8 @@ static ssize_t fill_registers_buffer(str
char *next; char *next;
u32 rdata; u32 rdata;
@ -66,7 +66,7 @@
regs = ahcd->regs; regs = ahcd->regs;
next = buf->page; next = buf->page;
size = PAGE_SIZE; size = PAGE_SIZE;
@@ -689,7 +679,7 @@ done: @@ -691,7 +681,7 @@ done:
} }
@ -75,7 +75,7 @@
ssize_t (*fill_func)(struct debug_buffer *)) ssize_t (*fill_func)(struct debug_buffer *))
{ {
struct debug_buffer *buf; struct debug_buffer *buf;
@@ -697,7 +687,7 @@ static struct debug_buffer *alloc_buffer @@ -699,7 +689,7 @@ static struct debug_buffer *alloc_buffer
buf = kzalloc(sizeof(struct debug_buffer), GFP_KERNEL); buf = kzalloc(sizeof(struct debug_buffer), GFP_KERNEL);
if (buf) { if (buf) {
@ -84,7 +84,7 @@
buf->fill_func = fill_func; buf->fill_func = fill_func;
mutex_init(&buf->mutex); mutex_init(&buf->mutex);
} }
@@ -790,26 +780,25 @@ static int debug_registers_open(struct i @@ -792,26 +782,25 @@ static int debug_registers_open(struct i
static inline void create_debug_files(struct admhcd *ahcd) static inline void create_debug_files(struct admhcd *ahcd)
{ {
struct usb_bus *bus = &admhcd_to_hcd(ahcd)->self; struct usb_bus *bus = &admhcd_to_hcd(ahcd)->self;

@ -7,5 +7,5 @@
- if (next) { \ - if (next) { \
+ if (next != NULL) { \ + if (next != NULL) { \
unsigned s_len; \ unsigned s_len; \
s_len = scnprintf(*next, *size, format, ## arg ); \ s_len = scnprintf(*next, *size, format, ## arg); \
*size -= s_len; *next += s_len; \ *size -= s_len; *next += s_len; \

@ -1,6 +1,6 @@
--- a/drivers/usb/host/adm5120-dbg.c --- a/drivers/usb/host/adm5120-dbg.c
+++ b/drivers/usb/host/adm5120-dbg.c +++ b/drivers/usb/host/adm5120-dbg.c
@@ -642,7 +642,7 @@ static ssize_t fill_registers_buffer(str @@ -644,7 +644,7 @@ static ssize_t fill_registers_buffer(str
hcd->product_desc, hcd->product_desc,
hcd_name); hcd_name);

@ -35,7 +35,7 @@
struct admhcd *ahcd; struct admhcd *ahcd;
struct ed **seen, *ed; struct ed **seen, *ed;
unsigned long flags; unsigned long flags;
@@ -529,9 +523,7 @@ static ssize_t fill_periodic_buffer(stru @@ -530,9 +524,7 @@ static ssize_t fill_periodic_buffer(stru
return 0; return 0;
seen_count = 0; seen_count = 0;
@ -46,7 +46,7 @@
next = buf->page; next = buf->page;
size = PAGE_SIZE; size = PAGE_SIZE;
@@ -613,7 +605,6 @@ static ssize_t fill_periodic_buffer(stru @@ -615,7 +607,6 @@ static ssize_t fill_periodic_buffer(stru
static ssize_t fill_registers_buffer(struct debug_buffer *buf) static ssize_t fill_registers_buffer(struct debug_buffer *buf)
{ {
@ -54,7 +54,7 @@
struct usb_hcd *hcd; struct usb_hcd *hcd;
struct admhcd *ahcd; struct admhcd *ahcd;
struct admhcd_regs __iomem *regs; struct admhcd_regs __iomem *regs;
@@ -622,9 +613,8 @@ static ssize_t fill_registers_buffer(str @@ -624,9 +615,8 @@ static ssize_t fill_registers_buffer(str
char *next; char *next;
u32 rdata; u32 rdata;
@ -66,7 +66,7 @@
regs = ahcd->regs; regs = ahcd->regs;
next = buf->page; next = buf->page;
size = PAGE_SIZE; size = PAGE_SIZE;
@@ -689,7 +679,7 @@ done: @@ -691,7 +681,7 @@ done:
} }
@ -75,7 +75,7 @@
ssize_t (*fill_func)(struct debug_buffer *)) ssize_t (*fill_func)(struct debug_buffer *))
{ {
struct debug_buffer *buf; struct debug_buffer *buf;
@@ -697,7 +687,7 @@ static struct debug_buffer *alloc_buffer @@ -699,7 +689,7 @@ static struct debug_buffer *alloc_buffer
buf = kzalloc(sizeof(struct debug_buffer), GFP_KERNEL); buf = kzalloc(sizeof(struct debug_buffer), GFP_KERNEL);
if (buf) { if (buf) {
@ -84,7 +84,7 @@
buf->fill_func = fill_func; buf->fill_func = fill_func;
mutex_init(&buf->mutex); mutex_init(&buf->mutex);
} }
@@ -790,26 +780,25 @@ static int debug_registers_open(struct i @@ -792,26 +782,25 @@ static int debug_registers_open(struct i
static inline void create_debug_files(struct admhcd *ahcd) static inline void create_debug_files(struct admhcd *ahcd)
{ {
struct usb_bus *bus = &admhcd_to_hcd(ahcd)->self; struct usb_bus *bus = &admhcd_to_hcd(ahcd)->self;

@ -22,14 +22,14 @@
#define NO_IRQ (-1) #define NO_IRQ (-1)
--- a/drivers/watchdog/adm5120_wdt.c --- a/drivers/watchdog/adm5120_wdt.c
+++ b/drivers/watchdog/adm5120_wdt.c +++ b/drivers/watchdog/adm5120_wdt.c
@@ -167,7 +167,7 @@ static struct file_operations wdt_fops = @@ -166,7 +166,7 @@ static const struct file_operations wdt_
owner: THIS_MODULE, .owner = THIS_MODULE,
llseek: no_llseek, .llseek = no_llseek,
write: wdt_write, .write = wdt_write,
- ioctl: wdt_ioctl, - .ioctl = wdt_ioctl,
+ unlocked_ioctl: wdt_ioctl, + .unlocked_ioctl = wdt_ioctl,
open: wdt_open, .open = wdt_open,
release: wdt_release, .release = wdt_release,
}; };
--- a/arch/mips/Kbuild.platforms --- a/arch/mips/Kbuild.platforms
+++ b/arch/mips/Kbuild.platforms +++ b/arch/mips/Kbuild.platforms

Loading…
Cancel
Save