summaryrefslogtreecommitdiffstats
path: root/drivers/media/radio
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2001-01-10 05:27:25 +0000
committerRalf Baechle <ralf@linux-mips.org>2001-01-10 05:27:25 +0000
commitc9c06167e7933d93a6e396174c68abf242294abb (patch)
treed9a8bb30663e9a3405a1ef37ffb62bc14b9f019f /drivers/media/radio
parentf79e8cc3c34e4192a3e5ef4cc9c6542fdef703c0 (diff)
Merge with Linux 2.4.0-test12.
Diffstat (limited to 'drivers/media/radio')
-rw-r--r--drivers/media/radio/radio-aimslab.c7
-rw-r--r--drivers/media/radio/radio-aztech.c6
-rw-r--r--drivers/media/radio/radio-cadet.c42
-rw-r--r--drivers/media/radio/radio-gemtek.c7
-rw-r--r--drivers/media/radio/radio-rtrack2.c6
-rw-r--r--drivers/media/radio/radio-sf16fmi.c6
-rw-r--r--drivers/media/radio/radio-terratec.c6
-rw-r--r--drivers/media/radio/radio-trust.c7
-rw-r--r--drivers/media/radio/radio-typhoon.c7
-rw-r--r--drivers/media/radio/radio-zoltrix.c14
10 files changed, 58 insertions, 50 deletions
diff --git a/drivers/media/radio/radio-aimslab.c b/drivers/media/radio/radio-aimslab.c
index b01c1562f..64bfad320 100644
--- a/drivers/media/radio/radio-aimslab.c
+++ b/drivers/media/radio/radio-aimslab.c
@@ -338,7 +338,7 @@ static int __init rtrack_init(void)
return -EINVAL;
}
- if (check_region(io, 2))
+ if (request_region(io, 2, "rtrack"))
{
printk(KERN_ERR "rtrack: port 0x%x already in use\n", io);
return -EBUSY;
@@ -347,9 +347,10 @@ static int __init rtrack_init(void)
rtrack_radio.priv=&rtrack_unit;
if(video_register_device(&rtrack_radio, VFL_TYPE_RADIO)==-1)
+ {
+ release_region(io, 2);
return -EINVAL;
-
- request_region(io, 2, "rtrack");
+ }
printk(KERN_INFO "AIMSlab RadioTrack/RadioReveal card driver.\n");
/* Set up the I/O locking */
diff --git a/drivers/media/radio/radio-aztech.c b/drivers/media/radio/radio-aztech.c
index 06999d806..971b62fe1 100644
--- a/drivers/media/radio/radio-aztech.c
+++ b/drivers/media/radio/radio-aztech.c
@@ -289,7 +289,7 @@ static int __init aztech_init(void)
return -EINVAL;
}
- if (check_region(io, 2))
+ if (request_region(io, 2, "aztech"))
{
printk(KERN_ERR "aztech: port 0x%x already in use\n", io);
return -EBUSY;
@@ -299,9 +299,11 @@ static int __init aztech_init(void)
aztech_radio.priv=&aztech_unit;
if(video_register_device(&aztech_radio, VFL_TYPE_RADIO)==-1)
+ {
+ release_region(io,2);
return -EINVAL;
+ }
- request_region(io, 2, "aztech");
printk(KERN_INFO "Aztech radio card driver v1.00/19990224 rkroll@exploits.org\n");
/* mute card - prevents noisy bootups */
outb (0, io);
diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c
index 15ec8515a..8ffe83a88 100644
--- a/drivers/media/radio/radio-cadet.c
+++ b/drivers/media/radio/radio-cadet.c
@@ -27,6 +27,7 @@
#include <linux/videodev.h> /* kernel radio structs */
#include <linux/config.h> /* CONFIG_RADIO_CADET_PORT */
#include <linux/param.h>
+#include <linux/isapnp.h>
#ifndef CONFIG_RADIO_CADET_PORT
#define CONFIG_RADIO_CADET_PORT 0x330
@@ -44,16 +45,9 @@ static __u8 rdsin=0,rdsout=0,rdsstat=0;
static unsigned char rdsbuf[RDS_BUFFER];
static int cadet_lock=0;
-#ifndef MODULE
static int cadet_probe(void);
-#endif
-
-#ifdef CONFIG_ISAPNP
-#include <linux/isapnp.h>
-
-struct pci_dev *dev;
+static struct pci_dev *dev;
static int isapnp_cadet_probe(void);
-#endif
/*
* Signal Strength Threshold Values
@@ -551,7 +545,6 @@ static struct video_device cadet_radio=
ioctl: cadet_ioctl,
};
-#ifdef CONFIG_ISAPNP
static int isapnp_cadet_probe(void)
{
dev = isapnp_find_dev (NULL, ISAPNP_VENDOR('M','S','M'),
@@ -574,9 +567,7 @@ static int isapnp_cadet_probe(void)
return io;
}
-#endif /* CONFIG_ISAPNP */
-#ifdef MODULE
static int cadet_probe(void)
{
static int iovals[8]={0x330,0x332,0x334,0x336,0x338,0x33a,0x33c,0x33e};
@@ -584,30 +575,35 @@ static int cadet_probe(void)
for(i=0;i<8;i++) {
io=iovals[i];
- if(check_region(io,2)>=0) {
+ if(request_region(io,2, "cadet-probe")>=0) {
cadet_setfreq(1410);
if(cadet_getfreq()==1410) {
+ release_region(io, 2);
return io;
}
+ release_region(io, 2);
}
}
return -1;
}
-#endif /* MODULE */
static int __init cadet_init(void)
{
-#ifdef CONFIG_ISAPNP
- io = isapnp_cadet_probe();
-
+ /*
+ * If a probe was requested then probe ISAPnP first (safest)
+ */
if (io < 0)
- return (io);
-#else
-#ifndef MODULE /* only probe on non-ISAPnP monolithic compiles */
- io = cadet_probe ();
-#endif /* MODULE */
-#endif /* CONFIG_ISAPNP */
+ io = isapnp_cadet_probe();
+ /*
+ * If that fails then probe unsafely if probe is requested
+ */
+ if(io < 0)
+ io = cadet_probe ();
+ /*
+ * Else we bail out
+ */
+
if(io < 0) {
#ifdef MODULE
printk(KERN_ERR "You must set an I/O address with io=0x???\n");
@@ -638,10 +634,8 @@ static void __exit cadet_cleanup_module(void)
video_unregister_device(&cadet_radio);
release_region(io,2);
-#ifdef CONFIG_ISAPNP
if (dev)
dev->deactivate(dev);
-#endif
}
module_init(cadet_init);
diff --git a/drivers/media/radio/radio-gemtek.c b/drivers/media/radio/radio-gemtek.c
index 4bac8dcfe..32351f653 100644
--- a/drivers/media/radio/radio-gemtek.c
+++ b/drivers/media/radio/radio-gemtek.c
@@ -265,7 +265,7 @@ static int __init gemtek_init(void)
return -EINVAL;
}
- if (check_region(io, 4))
+ if (request_region(io, 4, "gemtek"))
{
printk(KERN_ERR "gemtek: port 0x%x already in use\n", io);
return -EBUSY;
@@ -274,9 +274,10 @@ static int __init gemtek_init(void)
gemtek_radio.priv=&gemtek_unit;
if(video_register_device(&gemtek_radio, VFL_TYPE_RADIO)==-1)
+ {
+ release_region(io, 4);
return -EINVAL;
-
- request_region(io, 4, "gemtek");
+ }
printk(KERN_INFO "GemTek Radio Card driver.\n");
spin_lock_init(&lock);
diff --git a/drivers/media/radio/radio-rtrack2.c b/drivers/media/radio/radio-rtrack2.c
index ad479af32..d34315b2b 100644
--- a/drivers/media/radio/radio-rtrack2.c
+++ b/drivers/media/radio/radio-rtrack2.c
@@ -230,7 +230,7 @@ static int __init rtrack2_init(void)
printk(KERN_ERR "You must set an I/O address with io=0x20c or io=0x30c\n");
return -EINVAL;
}
- if (check_region(io, 4))
+ if (request_region(io, 4, "rtrack2"))
{
printk(KERN_ERR "rtrack2: port 0x%x already in use\n", io);
return -EBUSY;
@@ -240,9 +240,11 @@ static int __init rtrack2_init(void)
spin_lock_init(&lock);
if(video_register_device(&rtrack2_radio, VFL_TYPE_RADIO)==-1)
+ {
+ release_region(io, 4);
return -EINVAL;
+ }
- request_region(io, 4, "rtrack2");
printk(KERN_INFO "AIMSlab Radiotrack II card driver.\n");
/* mute card - prevents noisy bootups */
diff --git a/drivers/media/radio/radio-sf16fmi.c b/drivers/media/radio/radio-sf16fmi.c
index 13a155316..e2fa902ff 100644
--- a/drivers/media/radio/radio-sf16fmi.c
+++ b/drivers/media/radio/radio-sf16fmi.c
@@ -291,7 +291,7 @@ static int __init fmi_init(void)
printk(KERN_ERR "You must set an I/O address with io=0x???\n");
return -EINVAL;
}
- if (check_region(io, 2))
+ if (request_region(io, 2, "fmi"))
{
printk(KERN_ERR "fmi: port 0x%x already in use\n", io);
return -EBUSY;
@@ -306,9 +306,11 @@ static int __init fmi_init(void)
init_MUTEX(&lock);
if(video_register_device(&fmi_radio, VFL_TYPE_RADIO)==-1)
+ {
+ release_region(io, 2);
return -EINVAL;
+ }
- request_region(io, 2, "fmi");
printk(KERN_INFO "SF16FMx radio card driver at 0x%x.\n", io);
printk(KERN_INFO "(c) 1998 Petr Vandrovec, vandrove@vc.cvut.cz.\n");
/* mute card - prevents noisy bootups */
diff --git a/drivers/media/radio/radio-terratec.c b/drivers/media/radio/radio-terratec.c
index 28094e3cd..6f2ff8ee6 100644
--- a/drivers/media/radio/radio-terratec.c
+++ b/drivers/media/radio/radio-terratec.c
@@ -309,7 +309,7 @@ static int __init terratec_init(void)
printk(KERN_ERR "You must set an I/O address with io=0x???\n");
return -EINVAL;
}
- if (check_region(io, 2))
+ if (request_region(io, 2, "terratec"))
{
printk(KERN_ERR "TerraTec: port 0x%x already in use\n", io);
return -EBUSY;
@@ -320,9 +320,11 @@ static int __init terratec_init(void)
spin_lock_init(&lock);
if(video_register_device(&terratec_radio, VFL_TYPE_RADIO)==-1)
+ {
+ release_region(io,2);
return -EINVAL;
+ }
- request_region(io, 2, "terratec");
printk(KERN_INFO "TERRATEC ActivRadio Standalone card driver.\n");
/* mute card - prevents noisy bootups */
diff --git a/drivers/media/radio/radio-trust.c b/drivers/media/radio/radio-trust.c
index 2fb6ed26d..cf4aa8b00 100644
--- a/drivers/media/radio/radio-trust.c
+++ b/drivers/media/radio/radio-trust.c
@@ -300,14 +300,15 @@ static int __init trust_init(void)
printk(KERN_ERR "You must set an I/O address with io=0x???\n");
return -EINVAL;
}
- if(check_region(io, 2)) {
+ if(request_region(io, 2, "Trust FM Radio")) {
printk(KERN_ERR "trust: port 0x%x already in use\n", io);
return -EBUSY;
}
if(video_register_device(&trust_radio, VFL_TYPE_RADIO)==-1)
+ {
+ release_region(io, 2);
return -EINVAL;
-
- request_region(io, 2, "Trust FM Radio");
+ }
printk(KERN_INFO "Trust FM Radio card driver v1.0.\n");
diff --git a/drivers/media/radio/radio-typhoon.c b/drivers/media/radio/radio-typhoon.c
index c550fd45c..d02d7f1be 100644
--- a/drivers/media/radio/radio-typhoon.c
+++ b/drivers/media/radio/radio-typhoon.c
@@ -350,7 +350,7 @@ static int __init typhoon_init(void)
printk(KERN_INFO BANNER);
io = typhoon_unit.iobase;
- if (check_region(io, 8)) {
+ if (request_region(io, 8, "typhoon")) {
printk(KERN_ERR "radio-typhoon: port 0x%x already in use\n",
typhoon_unit.iobase);
return -EBUSY;
@@ -358,9 +358,10 @@ static int __init typhoon_init(void)
typhoon_radio.priv = &typhoon_unit;
if (video_register_device(&typhoon_radio, VFL_TYPE_RADIO) == -1)
+ {
+ release_region(io, 8);
return -EINVAL;
-
- request_region(typhoon_unit.iobase, 8, "typhoon");
+ }
printk(KERN_INFO "radio-typhoon: port 0x%x.\n", typhoon_unit.iobase);
printk(KERN_INFO "radio-typhoon: mute frequency is %lu kHz.\n",
typhoon_unit.mutefreq);
diff --git a/drivers/media/radio/radio-zoltrix.c b/drivers/media/radio/radio-zoltrix.c
index 940447bb9..e9adaef7a 100644
--- a/drivers/media/radio/radio-zoltrix.c
+++ b/drivers/media/radio/radio-zoltrix.c
@@ -355,20 +355,22 @@ static int __init zoltrix_init(void)
printk(KERN_ERR "You must set an I/O address with io=0x???\n");
return -EINVAL;
}
- if (check_region(io, 2)) {
- printk(KERN_ERR "zoltrix: port 0x%x already in use\n", io);
- return -EBUSY;
- }
if ((io != 0x20c) && (io != 0x30c)) {
printk(KERN_ERR "zoltrix: invalid port, try 0x20c or 0x30c\n");
return -ENXIO;
}
+
zoltrix_radio.priv = &zoltrix_unit;
+ if (request_region(io, 2, "zoltrix")) {
+ printk(KERN_ERR "zoltrix: port 0x%x already in use\n", io);
+ return -EBUSY;
+ }
if (video_register_device(&zoltrix_radio, VFL_TYPE_RADIO) == -1)
+ {
+ release_region(io, 2);
return -EINVAL;
-
- request_region(io, 2, "zoltrix");
+ }
printk(KERN_INFO "Zoltrix Radio Plus card driver.\n");
init_MUTEX(&zoltrix_unit.lock);