diff options
Diffstat (limited to 'drivers/telephony')
-rw-r--r-- | drivers/telephony/ixj.c | 7 | ||||
-rw-r--r-- | drivers/telephony/ixj_pcmcia.c | 41 |
2 files changed, 17 insertions, 31 deletions
diff --git a/drivers/telephony/ixj.c b/drivers/telephony/ixj.c index 5c6239e5aa2..0d236f4bb8c 100644 --- a/drivers/telephony/ixj.c +++ b/drivers/telephony/ixj.c @@ -257,7 +257,7 @@ #include <linux/fs.h> /* everything... */ #include <linux/errno.h> /* error codes */ #include <linux/slab.h> -#include <linux/smp_lock.h> +#include <linux/mutex.h> #include <linux/mm.h> #include <linux/ioport.h> #include <linux/interrupt.h> @@ -277,6 +277,7 @@ #define TYPE(inode) (iminor(inode) >> 4) #define NUM(inode) (iminor(inode) & 0xf) +static DEFINE_MUTEX(ixj_mutex); static int ixjdebug; static int hertz = HZ; static int samplerate = 100; @@ -6655,9 +6656,9 @@ static long do_ixj_ioctl(struct file *file_p, unsigned int cmd, unsigned long ar static long ixj_ioctl(struct file *file_p, unsigned int cmd, unsigned long arg) { long ret; - lock_kernel(); + mutex_lock(&ixj_mutex); ret = do_ixj_ioctl(file_p, cmd, arg); - unlock_kernel(); + mutex_unlock(&ixj_mutex); return ret; } diff --git a/drivers/telephony/ixj_pcmcia.c b/drivers/telephony/ixj_pcmcia.c index a1900e50251..d005b9eeebb 100644 --- a/drivers/telephony/ixj_pcmcia.c +++ b/drivers/telephony/ixj_pcmcia.c @@ -8,7 +8,6 @@ #include <linux/errno.h> /* error codes */ #include <linux/slab.h> -#include <pcmcia/cs.h> #include <pcmcia/cistpl.h> #include <pcmcia/ds.h> @@ -32,9 +31,6 @@ static int ixj_probe(struct pcmcia_device *p_dev) { dev_dbg(&p_dev->dev, "ixj_attach()\n"); /* Create new ixj device */ - p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; - p_dev->resource[1]->flags |= IO_DATA_PATH_WIDTH_8; - p_dev->conf.IntType = INT_MEMORY_AND_IO; p_dev->priv = kzalloc(sizeof(struct ixj_info_t), GFP_KERNEL); if (!p_dev->priv) { return -ENOMEM; @@ -111,40 +107,31 @@ failed: return; } -static int ixj_config_check(struct pcmcia_device *p_dev, - cistpl_cftable_entry_t *cfg, - cistpl_cftable_entry_t *dflt, - unsigned int vcc, - void *priv_data) +static int ixj_config_check(struct pcmcia_device *p_dev, void *priv_data) { - if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { - cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; - p_dev->resource[0]->start = io->win[0].base; - p_dev->resource[0]->end = io->win[0].len; - p_dev->io_lines = 3; - if (io->nwin == 2) { - p_dev->resource[1]->start = io->win[1].base; - p_dev->resource[1]->end = io->win[1].len; - } - if (!pcmcia_request_io(p_dev)) - return 0; - } - return -ENODEV; + p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; + p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; + p_dev->resource[1]->flags &= ~IO_DATA_PATH_WIDTH; + p_dev->resource[1]->flags |= IO_DATA_PATH_WIDTH_8; + p_dev->io_lines = 3; + + return pcmcia_request_io(p_dev); } static int ixj_config(struct pcmcia_device * link) { IXJ *j; ixj_info_t *info; - cistpl_cftable_entry_t dflt = { 0 }; info = link->priv; dev_dbg(&link->dev, "ixj_config\n"); - if (pcmcia_loop_config(link, ixj_config_check, &dflt)) + link->config_flags = CONF_AUTO_SET_IO; + + if (pcmcia_loop_config(link, ixj_config_check, NULL)) goto failed; - if (pcmcia_request_configuration(link, &link->conf)) + if (pcmcia_enable_device(link)) goto failed; /* @@ -178,9 +165,7 @@ MODULE_DEVICE_TABLE(pcmcia, ixj_ids); static struct pcmcia_driver ixj_driver = { .owner = THIS_MODULE, - .drv = { - .name = "ixj_cs", - }, + .name = "ixj_cs", .probe = ixj_probe, .remove = ixj_detach, .id_table = ixj_ids, |