提交 9828673d 编写于 作者: A Adrian Bunk 提交者: Linus Torvalds

[PATCH] paride: remove parport #ifdef's

CONFIG_PARIDE depends on CONFIG_PARPORT_PC, so there's no reason for
these #ifdef's.
Signed-off-by: NAdrian Bunk <bunk@stusta.de>
Acked-by: NAlan Cox <alan@redhat.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 4b358e22
...@@ -31,10 +31,7 @@ static int verbose; /* set this to 1 to see debugging messages and whatnot */ ...@@ -31,10 +31,7 @@ static int verbose; /* set this to 1 to see debugging messages and whatnot */
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/types.h> #include <linux/types.h>
#include <asm/io.h> #include <asm/io.h>
#if defined(CONFIG_PARPORT_MODULE)||defined(CONFIG_PARPORT)
#include <linux/parport.h> #include <linux/parport.h>
#endif
#include "ppc6lnx.c" #include "ppc6lnx.c"
#include "paride.h" #include "paride.h"
...@@ -139,11 +136,6 @@ static int bpck6_test_port ( PIA *pi ) /* check for 8-bit port */ ...@@ -139,11 +136,6 @@ static int bpck6_test_port ( PIA *pi ) /* check for 8-bit port */
PPCSTRUCT(pi)->ppc_id=pi->unit; PPCSTRUCT(pi)->ppc_id=pi->unit;
PPCSTRUCT(pi)->lpt_addr=pi->port; PPCSTRUCT(pi)->lpt_addr=pi->port;
#ifdef CONFIG_PARPORT_PC_MODULE
#define CONFIG_PARPORT_PC
#endif
#ifdef CONFIG_PARPORT_PC
/* look at the parport device to see if what modes we can use */ /* look at the parport device to see if what modes we can use */
if(((struct pardevice *)(pi->pardev))->port->modes & if(((struct pardevice *)(pi->pardev))->port->modes &
(PARPORT_MODE_EPP) (PARPORT_MODE_EPP)
...@@ -161,11 +153,6 @@ static int bpck6_test_port ( PIA *pi ) /* check for 8-bit port */ ...@@ -161,11 +153,6 @@ static int bpck6_test_port ( PIA *pi ) /* check for 8-bit port */
{ {
return 1; return 1;
} }
#else
/* there is no way of knowing what kind of port we have
default to the highest mode possible */
return 5;
#endif
} }
static int bpck6_probe_unit ( PIA *pi ) static int bpck6_probe_unit ( PIA *pi )
......
...@@ -29,14 +29,7 @@ ...@@ -29,14 +29,7 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/wait.h> #include <linux/wait.h>
#include <linux/sched.h> /* TASK_* */ #include <linux/sched.h> /* TASK_* */
#ifdef CONFIG_PARPORT_MODULE
#define CONFIG_PARPORT
#endif
#ifdef CONFIG_PARPORT
#include <linux/parport.h> #include <linux/parport.h>
#endif
#include "paride.h" #include "paride.h"
...@@ -76,8 +69,6 @@ void pi_read_block(PIA * pi, char *buf, int count) ...@@ -76,8 +69,6 @@ void pi_read_block(PIA * pi, char *buf, int count)
EXPORT_SYMBOL(pi_read_block); EXPORT_SYMBOL(pi_read_block);
#ifdef CONFIG_PARPORT
static void pi_wake_up(void *p) static void pi_wake_up(void *p)
{ {
PIA *pi = (PIA *) p; PIA *pi = (PIA *) p;
...@@ -100,11 +91,8 @@ static void pi_wake_up(void *p) ...@@ -100,11 +91,8 @@ static void pi_wake_up(void *p)
cont(); cont();
} }
#endif
int pi_schedule_claimed(PIA * pi, void (*cont) (void)) int pi_schedule_claimed(PIA * pi, void (*cont) (void))
{ {
#ifdef CONFIG_PARPORT
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&pi_spinlock, flags); spin_lock_irqsave(&pi_spinlock, flags);
...@@ -115,7 +103,6 @@ int pi_schedule_claimed(PIA * pi, void (*cont) (void)) ...@@ -115,7 +103,6 @@ int pi_schedule_claimed(PIA * pi, void (*cont) (void))
} }
pi->claimed = 1; pi->claimed = 1;
spin_unlock_irqrestore(&pi_spinlock, flags); spin_unlock_irqrestore(&pi_spinlock, flags);
#endif
return 1; return 1;
} }
EXPORT_SYMBOL(pi_schedule_claimed); EXPORT_SYMBOL(pi_schedule_claimed);
...@@ -133,20 +120,16 @@ static void pi_claim(PIA * pi) ...@@ -133,20 +120,16 @@ static void pi_claim(PIA * pi)
if (pi->claimed) if (pi->claimed)
return; return;
pi->claimed = 1; pi->claimed = 1;
#ifdef CONFIG_PARPORT
if (pi->pardev) if (pi->pardev)
wait_event(pi->parq, wait_event(pi->parq,
!parport_claim((struct pardevice *) pi->pardev)); !parport_claim((struct pardevice *) pi->pardev));
#endif
} }
static void pi_unclaim(PIA * pi) static void pi_unclaim(PIA * pi)
{ {
pi->claimed = 0; pi->claimed = 0;
#ifdef CONFIG_PARPORT
if (pi->pardev) if (pi->pardev)
parport_release((struct pardevice *) (pi->pardev)); parport_release((struct pardevice *) (pi->pardev));
#endif
} }
void pi_connect(PIA * pi) void pi_connect(PIA * pi)
...@@ -167,21 +150,15 @@ EXPORT_SYMBOL(pi_disconnect); ...@@ -167,21 +150,15 @@ EXPORT_SYMBOL(pi_disconnect);
static void pi_unregister_parport(PIA * pi) static void pi_unregister_parport(PIA * pi)
{ {
#ifdef CONFIG_PARPORT
if (pi->pardev) { if (pi->pardev) {
parport_unregister_device((struct pardevice *) (pi->pardev)); parport_unregister_device((struct pardevice *) (pi->pardev));
pi->pardev = NULL; pi->pardev = NULL;
} }
#endif
} }
void pi_release(PIA * pi) void pi_release(PIA * pi)
{ {
pi_unregister_parport(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) if (pi->proto->release_proto)
pi->proto->release_proto(pi); pi->proto->release_proto(pi);
module_put(pi->proto->owner); module_put(pi->proto->owner);
...@@ -269,8 +246,6 @@ EXPORT_SYMBOL(paride_unregister); ...@@ -269,8 +246,6 @@ EXPORT_SYMBOL(paride_unregister);
static int pi_register_parport(PIA * pi, int verbose) static int pi_register_parport(PIA * pi, int verbose)
{ {
#ifdef CONFIG_PARPORT
struct parport *port; struct parport *port;
port = parport_find_base(pi->port); port = parport_find_base(pi->port);
...@@ -290,7 +265,6 @@ static int pi_register_parport(PIA * pi, int verbose) ...@@ -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); printk("%s: 0x%x is %s\n", pi->device, pi->port, port->name);
pi->parname = (char *) port->name; pi->parname = (char *) port->name;
#endif
return 1; return 1;
} }
...@@ -447,13 +421,6 @@ int pi_init(PIA * pi, int autoprobe, int port, int mode, ...@@ -447,13 +421,6 @@ int pi_init(PIA * pi, int autoprobe, int port, int mode,
printk("%s: Adapter not found\n", device); printk("%s: Adapter not found\n", device);
return 0; 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) if (pi->parname)
printk("%s: Sharing %s at 0x%x\n", pi->device, printk("%s: Sharing %s at 0x%x\n", pi->device,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册