unsigned long);
static irqreturn_t ac_interrupt(int, void *, struct pt_regs *);
-static const struct file_operations ac_fops = {
+static struct file_operations ac_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
.read = ac_read,
if (!boardno)
boardno = readb(loc + NUMCARD_OWNER_TO_PC);
- if (!boardno || boardno > MAX_BOARD) {
+ if (!boardno && boardno > MAX_BOARD) {
printk(KERN_WARNING "Board #%d (at 0x%lx) is out of range (1 <= x <= %d).\n",
boardno, physloc, MAX_BOARD);
return 0;
return boardno + 1;
}
-static void __exit applicom_exit(void)
+#ifdef MODULE
+
+#define applicom_init init_module
+
+void cleanup_module(void)
{
unsigned int i;
}
}
-static int __init applicom_init(void)
+#endif /* MODULE */
+
+int __init applicom_init(void)
{
int i, numisa = 0;
struct pci_dev *dev = NULL;
RamIO = ioremap(dev->resource[0].start, LEN_RAM_IO);
if (!RamIO) {
- printk(KERN_INFO "ac.o: Failed to ioremap PCI memory "
- "space at 0x%llx\n",
- (unsigned long long)dev->resource[0].start);
+ printk(KERN_INFO "ac.o: Failed to ioremap PCI memory space at 0x%lx\n", dev->resource[0].start);
pci_disable_device(dev);
return -EIO;
}
- printk(KERN_INFO "Applicom %s found at mem 0x%llx, irq %d\n",
- applicom_pci_devnames[dev->device-1],
- (unsigned long long)dev->resource[0].start,
+ printk(KERN_INFO "Applicom %s found at mem 0x%lx, irq %d\n",
+ applicom_pci_devnames[dev->device-1], dev->resource[0].start,
dev->irq);
boardno = ac_register_board(dev->resource[0].start, RamIO,0);
continue;
}
- if (request_irq(dev->irq, &ac_interrupt, IRQF_SHARED, "Applicom PCI", &dummy)) {
+ if (request_irq(dev->irq, &ac_interrupt, SA_SHIRQ, "Applicom PCI", &dummy)) {
printk(KERN_INFO "Could not allocate IRQ %d for PCI Applicom device.\n", dev->irq);
iounmap(RamIO);
pci_disable_device(dev);
printk(KERN_NOTICE "Applicom ISA card found at mem 0x%lx, irq %d\n", mem + (LEN_RAM_IO*i), irq);
if (!numisa) {
- if (request_irq(irq, &ac_interrupt, IRQF_SHARED, "Applicom ISA", &dummy)) {
+ if (request_irq(irq, &ac_interrupt, SA_SHIRQ, "Applicom ISA", &dummy)) {
printk(KERN_WARNING "Could not allocate IRQ %d for ISA Applicom device.\n", irq);
iounmap(RamIO);
apbs[boardno - 1].RamIO = NULL;
return ret;
}
-module_init(applicom_init);
-module_exit(applicom_exit);
+#ifndef MODULE
+__initcall(applicom_init);
+#endif
static ssize_t ac_write(struct file *file, const char __user *buf, size_t count, loff_t * ppos)
{
return 0;
}
+#ifndef MODULE
+static int __init applicom_setup(char *str)
+{
+ int ints[4];
+
+ (void) get_options(str, 4, ints);
+
+ if (ints[0] > 2) {
+ printk(KERN_WARNING "Too many arguments to 'applicom=', expected mem,irq only.\n");
+ }
+
+ if (ints[0] < 2) {
+ printk(KERN_INFO"applicom numargs: %d\n", ints[0]);
+ return 0;
+ }
+
+ mem = ints[1];
+ irq = ints[2];
+ return 1;
+}
+
+__setup("applicom=", applicom_setup);
+
+#endif /* MODULE */
+