Commit 36dcfaba authored by Russell King's avatar Russell King

Update Acorn serial drivers.

parent 1a4457da
......@@ -20,7 +20,4 @@
#define MY_PORT_ADDRESS(port,cardaddr) \
((cardaddr) + 0x200 - (port) * 0x100)
#define INIT serial_card_atomwide_init
#define EXIT serial_card_atomwide_exit
#include "serial-card.c"
......@@ -29,6 +29,7 @@
#include <linux/types.h>
#include <linux/serial.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/init.h>
#include <asm/ecard.h>
......@@ -38,22 +39,10 @@
#define NUM_SERIALS MY_NUMPORTS * MAX_ECARDS
#endif
#ifdef MODULE
static int __serial_ports[NUM_SERIALS];
static int __serial_pcount;
static int __serial_addr[NUM_SERIALS];
static int serial_ports[NUM_SERIALS];
static int serial_pcount;
static int serial_addr[NUM_SERIALS];
static struct expansion_card *expcard[MAX_ECARDS];
#define ADD_ECARD(ec,card) expcard[(card)] = (ec)
#define ADD_PORT(port,addr) \
do { \
__serial_ports[__serial_pcount] = (port); \
__serial_addr[__serial_pcount] = (addr); \
__serial_pcount += 1; \
} while (0)
#else
#define ADD_ECARD(ec,card)
#define ADD_PORT(port,addr)
#endif
static const card_ids serial_cids[] = { MY_CARD_LIST, { 0xffff, 0xffff } };
......@@ -70,7 +59,7 @@ static inline int serial_register_onedev (unsigned long port, int irq)
return register_serial(&req);
}
static int __init INIT (void)
static int __init serial_card_init(void)
{
int card = 0;
......@@ -96,37 +85,38 @@ static int __init INIT (void)
line = serial_register_onedev (address, ec->irq);
if (line < 0)
break;
ADD_PORT(line, address);
serial_ports[serial_pcount] = line;
serial_addr[serial_pcount] = address;
serial_pcount += 1;
}
if (port) {
ecard_claim (ec);
ADD_ECARD(ec, card);
expcard[card] = ec;
} else
break;
} while (++card < MAX_ECARDS);
return card ? 0 : -ENODEV;
}
static void __exit EXIT (void)
static void __exit serial_card_exit(void)
{
#ifdef MODULE
int i;
for (i = 0; i < __serial_pcount; i++) {
unregister_serial(__serial_ports[i]);
release_region(__serial_addr[i], 8);
for (i = 0; i < serial_pcount; i++) {
unregister_serial(serial_ports[i]);
release_region(serial_addr[i], 8);
}
for (i = 0; i < MAX_ECARDS; i++)
if (expcard[i])
ecard_release (expcard[i]);
#endif
}
EXPORT_NO_SYMBOLS;
MODULE_AUTHOR("Russell King");
MODULE_LICENSE("GPL");
module_init(INIT);
module_exit(EXIT);
module_init(serial_card_init);
module_exit(serial_card_exit);
......@@ -18,7 +18,4 @@
#define MY_PORT_ADDRESS(port,cardaddress) \
((cardaddress) + (port) * 8)
#define INIT serial_card_dualsp_init
#define EXIT serial_card_dualsp_exit
#include "serial-card.c"
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