Commit 99cde44e authored by Arvind Yadav's avatar Arvind Yadav Committed by Helge Deller

parisc: eisa: Remove coding style errors

This patch removes coding style errors in the eisa driver.
Signed-off-by: default avatarArvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent 6e5c8381
...@@ -14,16 +14,16 @@ ...@@ -14,16 +14,16 @@
* Wax ASIC also includes a PS/2 and RS-232 controller, but those are * Wax ASIC also includes a PS/2 and RS-232 controller, but those are
* dealt with elsewhere; this file is concerned only with the EISA portions * dealt with elsewhere; this file is concerned only with the EISA portions
* of Wax. * of Wax.
* *
* *
* HINT: * HINT:
* ----- * -----
* To allow an ISA card to work properly in the EISA slot you need to * To allow an ISA card to work properly in the EISA slot you need to
* set an edge trigger level. This may be done on the palo command line * set an edge trigger level. This may be done on the palo command line
* by adding the kernel parameter "eisa_irq_edge=n,n2,[...]]", with * by adding the kernel parameter "eisa_irq_edge=n,n2,[...]]", with
* n and n2 as the irq levels you want to use. * n and n2 as the irq levels you want to use.
* *
* Example: "eisa_irq_edge=10,11" allows ISA cards to operate at * Example: "eisa_irq_edge=10,11" allows ISA cards to operate at
* irq levels 10 and 11. * irq levels 10 and 11.
*/ */
...@@ -46,9 +46,9 @@ ...@@ -46,9 +46,9 @@
#include <asm/eisa_eeprom.h> #include <asm/eisa_eeprom.h>
#if 0 #if 0
#define EISA_DBG(msg, arg... ) printk(KERN_DEBUG "eisa: " msg , ## arg ) #define EISA_DBG(msg, arg...) printk(KERN_DEBUG "eisa: " msg, ## arg)
#else #else
#define EISA_DBG(msg, arg... ) #define EISA_DBG(msg, arg...)
#endif #endif
#define SNAKES_EEPROM_BASE_ADDR 0xF0810400 #define SNAKES_EEPROM_BASE_ADDR 0xF0810400
...@@ -108,7 +108,7 @@ void eisa_out8(unsigned char data, unsigned short port) ...@@ -108,7 +108,7 @@ void eisa_out8(unsigned char data, unsigned short port)
void eisa_out16(unsigned short data, unsigned short port) void eisa_out16(unsigned short data, unsigned short port)
{ {
if (EISA_bus) if (EISA_bus)
gsc_writew(cpu_to_le16(data), eisa_permute(port)); gsc_writew(cpu_to_le16(data), eisa_permute(port));
} }
...@@ -135,9 +135,9 @@ static int master_mask; ...@@ -135,9 +135,9 @@ static int master_mask;
static int slave_mask; static int slave_mask;
/* the trig level can be set with the /* the trig level can be set with the
* eisa_irq_edge=n,n,n commandline parameter * eisa_irq_edge=n,n,n commandline parameter
* We should really read this from the EEPROM * We should really read this from the EEPROM
* in the furure. * in the furure.
*/ */
/* irq 13,8,2,1,0 must be edge */ /* irq 13,8,2,1,0 must be edge */
static unsigned int eisa_irq_level __read_mostly; /* default to edge triggered */ static unsigned int eisa_irq_level __read_mostly; /* default to edge triggered */
...@@ -170,7 +170,7 @@ static void eisa_unmask_irq(struct irq_data *d) ...@@ -170,7 +170,7 @@ static void eisa_unmask_irq(struct irq_data *d)
unsigned int irq = d->irq; unsigned int irq = d->irq;
unsigned long flags; unsigned long flags;
EISA_DBG("enable irq %d\n", irq); EISA_DBG("enable irq %d\n", irq);
spin_lock_irqsave(&eisa_irq_lock, flags); spin_lock_irqsave(&eisa_irq_lock, flags);
if (irq & 8) { if (irq & 8) {
slave_mask &= ~(1 << (irq&7)); slave_mask &= ~(1 << (irq&7));
...@@ -194,7 +194,7 @@ static irqreturn_t eisa_irq(int wax_irq, void *intr_dev) ...@@ -194,7 +194,7 @@ static irqreturn_t eisa_irq(int wax_irq, void *intr_dev)
{ {
int irq = gsc_readb(0xfc01f000); /* EISA supports 16 irqs */ int irq = gsc_readb(0xfc01f000); /* EISA supports 16 irqs */
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&eisa_irq_lock, flags); spin_lock_irqsave(&eisa_irq_lock, flags);
/* read IRR command */ /* read IRR command */
eisa_out8(0x0a, 0x20); eisa_out8(0x0a, 0x20);
...@@ -202,31 +202,31 @@ static irqreturn_t eisa_irq(int wax_irq, void *intr_dev) ...@@ -202,31 +202,31 @@ static irqreturn_t eisa_irq(int wax_irq, void *intr_dev)
EISA_DBG("irq IAR %02x 8259-1 irr %02x 8259-2 irr %02x\n", EISA_DBG("irq IAR %02x 8259-1 irr %02x 8259-2 irr %02x\n",
irq, eisa_in8(0x20), eisa_in8(0xa0)); irq, eisa_in8(0x20), eisa_in8(0xa0));
/* read ISR command */ /* read ISR command */
eisa_out8(0x0a, 0x20); eisa_out8(0x0a, 0x20);
eisa_out8(0x0a, 0xa0); eisa_out8(0x0a, 0xa0);
EISA_DBG("irq 8259-1 isr %02x imr %02x 8259-2 isr %02x imr %02x\n", EISA_DBG("irq 8259-1 isr %02x imr %02x 8259-2 isr %02x imr %02x\n",
eisa_in8(0x20), eisa_in8(0x21), eisa_in8(0xa0), eisa_in8(0xa1)); eisa_in8(0x20), eisa_in8(0x21), eisa_in8(0xa0), eisa_in8(0xa1));
irq &= 0xf; irq &= 0xf;
/* mask irq and write eoi */ /* mask irq and write eoi */
if (irq & 8) { if (irq & 8) {
slave_mask |= (1 << (irq&7)); slave_mask |= (1 << (irq&7));
eisa_out8(slave_mask, 0xa1); eisa_out8(slave_mask, 0xa1);
eisa_out8(0x60 | (irq&7),0xa0);/* 'Specific EOI' to slave */ eisa_out8(0x60 | (irq&7),0xa0);/* 'Specific EOI' to slave */
eisa_out8(0x62,0x20); /* 'Specific EOI' to master-IRQ2 */ eisa_out8(0x62, 0x20); /* 'Specific EOI' to master-IRQ2 */
} else { } else {
master_mask |= (1 << (irq&7)); master_mask |= (1 << (irq&7));
eisa_out8(master_mask, 0x21); eisa_out8(master_mask, 0x21);
eisa_out8(0x60|irq,0x20); /* 'Specific EOI' to master */ eisa_out8(0x60|irq, 0x20); /* 'Specific EOI' to master */
} }
spin_unlock_irqrestore(&eisa_irq_lock, flags); spin_unlock_irqrestore(&eisa_irq_lock, flags);
generic_handle_irq(irq); generic_handle_irq(irq);
spin_lock_irqsave(&eisa_irq_lock, flags); spin_lock_irqsave(&eisa_irq_lock, flags);
/* unmask */ /* unmask */
if (irq & 8) { if (irq & 8) {
...@@ -254,44 +254,44 @@ static struct irqaction irq2_action = { ...@@ -254,44 +254,44 @@ static struct irqaction irq2_action = {
static void init_eisa_pic(void) static void init_eisa_pic(void)
{ {
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&eisa_irq_lock, flags); spin_lock_irqsave(&eisa_irq_lock, flags);
eisa_out8(0xff, 0x21); /* mask during init */ eisa_out8(0xff, 0x21); /* mask during init */
eisa_out8(0xff, 0xa1); /* mask during init */ eisa_out8(0xff, 0xa1); /* mask during init */
/* master pic */ /* master pic */
eisa_out8(0x11,0x20); /* ICW1 */ eisa_out8(0x11, 0x20); /* ICW1 */
eisa_out8(0x00,0x21); /* ICW2 */ eisa_out8(0x00, 0x21); /* ICW2 */
eisa_out8(0x04,0x21); /* ICW3 */ eisa_out8(0x04, 0x21); /* ICW3 */
eisa_out8(0x01,0x21); /* ICW4 */ eisa_out8(0x01, 0x21); /* ICW4 */
eisa_out8(0x40,0x20); /* OCW2 */ eisa_out8(0x40, 0x20); /* OCW2 */
/* slave pic */ /* slave pic */
eisa_out8(0x11,0xa0); /* ICW1 */ eisa_out8(0x11, 0xa0); /* ICW1 */
eisa_out8(0x08,0xa1); /* ICW2 */ eisa_out8(0x08, 0xa1); /* ICW2 */
eisa_out8(0x02,0xa1); /* ICW3 */ eisa_out8(0x02, 0xa1); /* ICW3 */
eisa_out8(0x01,0xa1); /* ICW4 */ eisa_out8(0x01, 0xa1); /* ICW4 */
eisa_out8(0x40,0xa0); /* OCW2 */ eisa_out8(0x40, 0xa0); /* OCW2 */
udelay(100); udelay(100);
slave_mask = 0xff; slave_mask = 0xff;
master_mask = 0xfb; master_mask = 0xfb;
eisa_out8(slave_mask, 0xa1); /* OCW1 */ eisa_out8(slave_mask, 0xa1); /* OCW1 */
eisa_out8(master_mask, 0x21); /* OCW1 */ eisa_out8(master_mask, 0x21); /* OCW1 */
/* setup trig level */ /* setup trig level */
EISA_DBG("EISA edge/level %04x\n", eisa_irq_level); EISA_DBG("EISA edge/level %04x\n", eisa_irq_level);
eisa_out8(eisa_irq_level&0xff, 0x4d0); /* Set all irq's to edge */ eisa_out8(eisa_irq_level&0xff, 0x4d0); /* Set all irq's to edge */
eisa_out8((eisa_irq_level >> 8) & 0xff, 0x4d1); eisa_out8((eisa_irq_level >> 8) & 0xff, 0x4d1);
EISA_DBG("pic0 mask %02x\n", eisa_in8(0x21)); EISA_DBG("pic0 mask %02x\n", eisa_in8(0x21));
EISA_DBG("pic1 mask %02x\n", eisa_in8(0xa1)); EISA_DBG("pic1 mask %02x\n", eisa_in8(0xa1));
EISA_DBG("pic0 edge/level %02x\n", eisa_in8(0x4d0)); EISA_DBG("pic0 edge/level %02x\n", eisa_in8(0x4d0));
EISA_DBG("pic1 edge/level %02x\n", eisa_in8(0x4d1)); EISA_DBG("pic1 edge/level %02x\n", eisa_in8(0x4d1));
spin_unlock_irqrestore(&eisa_irq_lock, flags); spin_unlock_irqrestore(&eisa_irq_lock, flags);
} }
...@@ -305,7 +305,7 @@ static int __init eisa_probe(struct parisc_device *dev) ...@@ -305,7 +305,7 @@ static int __init eisa_probe(struct parisc_device *dev)
char *name = is_mongoose(dev) ? "Mongoose" : "Wax"; char *name = is_mongoose(dev) ? "Mongoose" : "Wax";
printk(KERN_INFO "%s EISA Adapter found at 0x%08lx\n", printk(KERN_INFO "%s EISA Adapter found at 0x%08lx\n",
name, (unsigned long)dev->hpa.start); name, (unsigned long)dev->hpa.start);
eisa_dev.hba.dev = dev; eisa_dev.hba.dev = dev;
...@@ -336,14 +336,14 @@ static int __init eisa_probe(struct parisc_device *dev) ...@@ -336,14 +336,14 @@ static int __init eisa_probe(struct parisc_device *dev)
printk(KERN_ERR "EISA: request_irq failed!\n"); printk(KERN_ERR "EISA: request_irq failed!\n");
return result; return result;
} }
/* Reserve IRQ2 */ /* Reserve IRQ2 */
setup_irq(2, &irq2_action); setup_irq(2, &irq2_action);
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
irq_set_chip_and_handler(i, &eisa_interrupt_type, irq_set_chip_and_handler(i, &eisa_interrupt_type,
handle_simple_irq); handle_simple_irq);
} }
EISA_bus = 1; EISA_bus = 1;
if (dev->num_addrs) { if (dev->num_addrs) {
...@@ -375,7 +375,7 @@ static int __init eisa_probe(struct parisc_device *dev) ...@@ -375,7 +375,7 @@ static int __init eisa_probe(struct parisc_device *dev)
return -1; return -1;
} }
} }
return 0; return 0;
} }
...@@ -404,7 +404,7 @@ void eisa_make_irq_level(int num) ...@@ -404,7 +404,7 @@ void eisa_make_irq_level(int num)
{ {
if (eisa_irq_configured& (1<<num)) { if (eisa_irq_configured& (1<<num)) {
printk(KERN_WARNING printk(KERN_WARNING
"IRQ %d polarity configured twice (last to level)\n", "IRQ %d polarity configured twice (last to level)\n",
num); num);
} }
eisa_irq_level |= (1<<num); /* set the corresponding bit */ eisa_irq_level |= (1<<num); /* set the corresponding bit */
...@@ -414,7 +414,7 @@ void eisa_make_irq_level(int num) ...@@ -414,7 +414,7 @@ void eisa_make_irq_level(int num)
void eisa_make_irq_edge(int num) void eisa_make_irq_edge(int num)
{ {
if (eisa_irq_configured& (1<<num)) { if (eisa_irq_configured& (1<<num)) {
printk(KERN_WARNING printk(KERN_WARNING
"IRQ %d polarity configured twice (last to edge)\n", "IRQ %d polarity configured twice (last to edge)\n",
num); num);
} }
...@@ -430,18 +430,18 @@ static int __init eisa_irq_setup(char *str) ...@@ -430,18 +430,18 @@ static int __init eisa_irq_setup(char *str)
EISA_DBG("IRQ setup\n"); EISA_DBG("IRQ setup\n");
while (cur != NULL) { while (cur != NULL) {
char *pe; char *pe;
val = (int) simple_strtoul(cur, &pe, 0); val = (int) simple_strtoul(cur, &pe, 0);
if (val > 15 || val < 0) { if (val > 15 || val < 0) {
printk(KERN_ERR "eisa: EISA irq value are 0-15\n"); printk(KERN_ERR "eisa: EISA irq value are 0-15\n");
continue; continue;
} }
if (val == 2) { if (val == 2) {
val = 9; val = 9;
} }
eisa_make_irq_edge(val); /* clear the corresponding bit */ eisa_make_irq_edge(val); /* clear the corresponding bit */
EISA_DBG("setting IRQ %d to edge-triggered mode\n", val); EISA_DBG("setting IRQ %d to edge-triggered mode\n", val);
if ((cur = strchr(cur, ','))) { if ((cur = strchr(cur, ','))) {
cur++; cur++;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment