summaryrefslogtreecommitdiffstats
path: root/drivers/char/joystick
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-11-23 02:00:47 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-11-23 02:00:47 +0000
commit06615f62b17d7de6e12d2f5ec6b88cf30af08413 (patch)
tree8766f208847d4876a6db619aebbf54d53b76eb44 /drivers/char/joystick
parentfa9bdb574f4febb751848a685d9a9017e04e1d53 (diff)
Merge with Linux 2.4.0-test10.
Diffstat (limited to 'drivers/char/joystick')
-rw-r--r--drivers/char/joystick/gameport.c6
-rw-r--r--drivers/char/joystick/ns558.c24
-rw-r--r--drivers/char/joystick/serio.c6
3 files changed, 20 insertions, 16 deletions
diff --git a/drivers/char/joystick/gameport.c b/drivers/char/joystick/gameport.c
index 5a5e1219b..15ef908a6 100644
--- a/drivers/char/joystick/gameport.c
+++ b/drivers/char/joystick/gameport.c
@@ -51,9 +51,9 @@ EXPORT_SYMBOL(gameport_close);
EXPORT_SYMBOL(gameport_rescan);
EXPORT_SYMBOL(gameport_cooked_read);
-static struct gameport *gameport_list = NULL;
-static struct gameport_dev *gameport_dev = NULL;
-static int gameport_number = 0;
+static struct gameport *gameport_list;
+static struct gameport_dev *gameport_dev;
+static int gameport_number;
/*
* gameport_measure_speed() measures the gameport i/o speed.
diff --git a/drivers/char/joystick/ns558.c b/drivers/char/joystick/ns558.c
index 9ea833113..573eac51b 100644
--- a/drivers/char/joystick/ns558.c
+++ b/drivers/char/joystick/ns558.c
@@ -57,7 +57,8 @@ struct ns558 {
struct gameport gameport;
};
-static struct ns558 *ns558 = NULL;
+static struct ns558 *ns558;
+static int have_pci_devices;
/*
* ns558_isa_probe() tries to find an isa gameport at the
@@ -311,6 +312,15 @@ int __init ns558_init(void)
#endif
/*
+ * Probe for PCI ports. Always probe for PCI first,
+ * it is the least-invasive probe.
+ */
+
+ i = pci_module_init(&ns558_pci_driver);
+ if (i == 0)
+ have_pci_devices = 1;
+
+/*
* Probe for ISA ports.
*/
@@ -329,14 +339,7 @@ int __init ns558_init(void)
}
#endif
-/*
- * Probe for PCI ports.
- */
-
- if (!ns558 && pci_module_init(&ns558_pci_driver))
- return -ENODEV;
-
- return 0;
+ return ns558 ? 0 : -ENODEV;
}
void __exit ns558_exit(void)
@@ -365,7 +368,8 @@ void __exit ns558_exit(void)
port = port->next;
}
- pci_unregister_driver(&ns558_pci_driver);
+ if (have_pci_devices)
+ pci_unregister_driver(&ns558_pci_driver);
}
module_init(ns558_init);
diff --git a/drivers/char/joystick/serio.c b/drivers/char/joystick/serio.c
index 9595f0a6c..7dc5cd5a1 100644
--- a/drivers/char/joystick/serio.c
+++ b/drivers/char/joystick/serio.c
@@ -44,9 +44,9 @@ EXPORT_SYMBOL(serio_open);
EXPORT_SYMBOL(serio_close);
EXPORT_SYMBOL(serio_rescan);
-static struct serio *serio_list = NULL;
-static struct serio_dev *serio_dev = NULL;
-static int serio_number = 0;
+static struct serio *serio_list;
+static struct serio_dev *serio_dev;
+static int serio_number;
static void serio_find_dev(struct serio *serio)
{