diff options
Diffstat (limited to 'drivers/block/paride/paride.c')
-rw-r--r-- | drivers/block/paride/paride.c | 47 |
1 files changed, 7 insertions, 40 deletions
diff --git a/drivers/block/paride/paride.c b/drivers/block/paride/paride.c index 4b258f7836f..48c50f11f63 100644 --- a/drivers/block/paride/paride.c +++ b/drivers/block/paride/paride.c @@ -29,14 +29,7 @@ #include <linux/spinlock.h> #include <linux/wait.h> #include <linux/sched.h> /* TASK_* */ - -#ifdef CONFIG_PARPORT_MODULE -#define CONFIG_PARPORT -#endif - -#ifdef CONFIG_PARPORT #include <linux/parport.h> -#endif #include "paride.h" @@ -76,8 +69,6 @@ void pi_read_block(PIA * pi, char *buf, int count) EXPORT_SYMBOL(pi_read_block); -#ifdef CONFIG_PARPORT - static void pi_wake_up(void *p) { PIA *pi = (PIA *) p; @@ -100,11 +91,8 @@ static void pi_wake_up(void *p) cont(); } -#endif - int pi_schedule_claimed(PIA * pi, void (*cont) (void)) { -#ifdef CONFIG_PARPORT unsigned long flags; spin_lock_irqsave(&pi_spinlock, flags); @@ -115,7 +103,6 @@ int pi_schedule_claimed(PIA * pi, void (*cont) (void)) } pi->claimed = 1; spin_unlock_irqrestore(&pi_spinlock, flags); -#endif return 1; } EXPORT_SYMBOL(pi_schedule_claimed); @@ -133,20 +120,16 @@ static void pi_claim(PIA * pi) if (pi->claimed) return; pi->claimed = 1; -#ifdef CONFIG_PARPORT if (pi->pardev) wait_event(pi->parq, !parport_claim((struct pardevice *) pi->pardev)); -#endif } static void pi_unclaim(PIA * pi) { pi->claimed = 0; -#ifdef CONFIG_PARPORT if (pi->pardev) parport_release((struct pardevice *) (pi->pardev)); -#endif } void pi_connect(PIA * pi) @@ -167,21 +150,15 @@ EXPORT_SYMBOL(pi_disconnect); static void pi_unregister_parport(PIA * pi) { -#ifdef CONFIG_PARPORT if (pi->pardev) { parport_unregister_device((struct pardevice *) (pi->pardev)); pi->pardev = NULL; } -#endif } void pi_release(PIA * pi) { pi_unregister_parport(pi); -#ifndef CONFIG_PARPORT - if (pi->reserved) - release_region(pi->port, pi->reserved); -#endif /* !CONFIG_PARPORT */ if (pi->proto->release_proto) pi->proto->release_proto(pi); module_put(pi->proto->owner); @@ -229,7 +206,7 @@ static int pi_test_proto(PIA * pi, char *scratch, int verbose) return res; } -int pi_register(PIP * pr) +int paride_register(PIP * pr) { int k; @@ -237,24 +214,24 @@ int pi_register(PIP * pr) if (protocols[k] && !strcmp(pr->name, protocols[k]->name)) { printk("paride: %s protocol already registered\n", pr->name); - return 0; + return -1; } k = 0; while ((k < MAX_PROTOS) && (protocols[k])) k++; if (k == MAX_PROTOS) { printk("paride: protocol table full\n"); - return 0; + return -1; } protocols[k] = pr; pr->index = k; printk("paride: %s registered as protocol %d\n", pr->name, k); - return 1; + return 0; } -EXPORT_SYMBOL(pi_register); +EXPORT_SYMBOL(paride_register); -void pi_unregister(PIP * pr) +void paride_unregister(PIP * pr) { if (!pr) return; @@ -265,12 +242,10 @@ void pi_unregister(PIP * pr) protocols[pr->index] = NULL; } -EXPORT_SYMBOL(pi_unregister); +EXPORT_SYMBOL(paride_unregister); static int pi_register_parport(PIA * pi, int verbose) { -#ifdef CONFIG_PARPORT - struct parport *port; port = parport_find_base(pi->port); @@ -290,7 +265,6 @@ static int pi_register_parport(PIA * pi, int verbose) printk("%s: 0x%x is %s\n", pi->device, pi->port, port->name); pi->parname = (char *) port->name; -#endif return 1; } @@ -447,13 +421,6 @@ int pi_init(PIA * pi, int autoprobe, int port, int mode, printk("%s: Adapter not found\n", device); return 0; } -#ifndef CONFIG_PARPORT - if (!request_region(pi->port, pi->reserved, pi->device)) { - printk(KERN_WARNING "paride: Unable to request region 0x%x\n", - pi->port); - return 0; - } -#endif /* !CONFIG_PARPORT */ if (pi->parname) printk("%s: Sharing %s at 0x%x\n", pi->device, |