summaryrefslogtreecommitdiffstats
path: root/sound/oss/esssolo1.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-27 14:47:31 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-27 14:47:31 -0700
commit3e0777b8fa96f7073ed5d13d3bc1d573b766bef9 (patch)
tree3849e8457dd8f038ab7da025c708e275b43ea9c1 /sound/oss/esssolo1.c
parenta94130e00038ebeb2f66901a4a4a9e05a03051c1 (diff)
parente5119885f00874453e837e3407014b73de2f4741 (diff)
downloadop-kernel-dev-3e0777b8fa96f7073ed5d13d3bc1d573b766bef9.zip
op-kernel-dev-3e0777b8fa96f7073ed5d13d3bc1d573b766bef9.tar.gz
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/dtor/input.git manually
Some manual fixups required due to clashes with the PF_FREEZE cleanups.
Diffstat (limited to 'sound/oss/esssolo1.c')
-rw-r--r--sound/oss/esssolo1.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/sound/oss/esssolo1.c b/sound/oss/esssolo1.c
index fb09065..a4ecab2f 100644
--- a/sound/oss/esssolo1.c
+++ b/sound/oss/esssolo1.c
@@ -150,6 +150,10 @@
#define FMODE_DMFM 0x10
+#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
+#define SUPPORT_JOYSTICK 1
+#endif
+
static struct pci_driver solo1_driver;
/* --------------------------------------------------------------------- */
@@ -227,7 +231,9 @@ struct solo1_state {
unsigned char obuf[MIDIOUTBUF];
} midi;
+#if SUPPORT_JOYSTICK
struct gameport *gameport;
+#endif
};
/* --------------------------------------------------------------------- */
@@ -2281,6 +2287,7 @@ solo1_resume(struct pci_dev *pci_dev) {
return 0;
}
+#ifdef SUPPORT_JOYSTICK
static int __devinit solo1_register_gameport(struct solo1_state *s, int io_port)
{
struct gameport *gp;
@@ -2307,6 +2314,19 @@ static int __devinit solo1_register_gameport(struct solo1_state *s, int io_port)
return 0;
}
+static inline void solo1_unregister_gameport(struct solo1_state *s)
+{
+ if (s->gameport) {
+ int gpio = s->gameport->io;
+ gameport_unregister_port(s->gameport);
+ release_region(gpio, GAMEPORT_EXTENT);
+ }
+}
+#else
+static inline int solo1_register_gameport(struct solo1_state *s, int io_port) { return -ENOSYS; }
+static inline void solo1_unregister_gameport(struct solo1_state *s) { }
+#endif /* SUPPORT_JOYSTICK */
+
static int __devinit solo1_probe(struct pci_dev *pcidev, const struct pci_device_id *pciid)
{
struct solo1_state *s;
@@ -2438,11 +2458,7 @@ static void __devexit solo1_remove(struct pci_dev *dev)
synchronize_irq(s->irq);
pci_write_config_word(s->dev, 0x60, 0); /* turn off DDMA controller address space */
free_irq(s->irq, s);
- if (s->gameport) {
- int gpio = s->gameport->io;
- gameport_unregister_port(s->gameport);
- release_region(gpio, GAMEPORT_EXTENT);
- }
+ solo1_unregister_gameport(s);
release_region(s->iobase, IOBASE_EXTENT);
release_region(s->sbbase+FMSYNTH_EXTENT, SBBASE_EXTENT-FMSYNTH_EXTENT);
release_region(s->ddmabase, DDMABASE_EXTENT);
OpenPOWER on IntegriCloud