summaryrefslogtreecommitdiffstats
path: root/drivers/telephony
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-06-19 22:45:37 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-06-19 22:45:37 +0000
commit6d403070f28cd44860fdb3a53be5da0275c65cf4 (patch)
tree0d0e7fe7b5fb7568d19e11d7d862b77a866ce081 /drivers/telephony
parentecf1bf5f6c2e668d03b0a9fb026db7aa41e292e1 (diff)
Merge with 2.4.0-test1-ac21 + pile of MIPS cleanups to make merging
possible. Chainsawed RM200 kernel to compile again. Jazz machine status unknown.
Diffstat (limited to 'drivers/telephony')
-rw-r--r--drivers/telephony/ixj.c31
-rw-r--r--drivers/telephony/ixj.h1
-rw-r--r--drivers/telephony/phonedev.c13
3 files changed, 22 insertions, 23 deletions
diff --git a/drivers/telephony/ixj.c b/drivers/telephony/ixj.c
index 6a5af7943..043d57bbc 100644
--- a/drivers/telephony/ixj.c
+++ b/drivers/telephony/ixj.c
@@ -446,8 +446,7 @@ static void ixj_timeout(unsigned long ptr)
{
j->m_hook = 0;
j->ex.bits.hookstate = 1;
- if (j->async_queue)
- kill_fasync(j->async_queue, SIGIO, POLL_IN); // Send apps notice of change
+ kill_fasync(&j->async_queue, SIGIO, POLL_IN); // Send apps notice of change
}
goto timer_end;
}
@@ -536,8 +535,7 @@ static void ixj_timeout(unsigned long ptr)
j->proc_load = j->ssr.high << 8 | j->ssr.low;
if (!j->m_hook) {
j->m_hook = j->ex.bits.hookstate = 1;
- if (j->async_queue)
- kill_fasync(j->async_queue, SIGIO, POLL_IN); // Send apps notice of change
+ kill_fasync(&j->async_queue, SIGIO, POLL_IN); // Send apps notice of change
}
} else {
if (j->dsp.low == 0x21 &&
@@ -552,8 +550,7 @@ static void ixj_timeout(unsigned long ptr)
if (j->m_hook) {
j->m_hook = 0;
j->ex.bits.hookstate = 1;
- if (j->async_queue)
- kill_fasync(j->async_queue, SIGIO, POLL_IN); // Send apps notice of change
+ kill_fasync(&j->async_queue, SIGIO, POLL_IN); // Send apps notice of change
}
}
}
@@ -642,8 +639,7 @@ static void ixj_timeout(unsigned long ptr)
}
if (j->ex.bytes) {
wake_up_interruptible(&j->poll_q); // Wake any blocked selects
- if (j->async_queue)
- kill_fasync(j->async_queue, SIGIO, POLL_IN); // Send apps notice of change
+ kill_fasync(&j->async_queue, SIGIO, POLL_IN); // Send apps notice of change
}
} else {
break;
@@ -917,8 +913,7 @@ static int ixj_hookstate(int board)
j->r_hook = fOffHook;
if (j->port != PORT_POTS) {
j->ex.bits.hookstate = 1;
- if (j->async_queue)
- kill_fasync(j->async_queue, SIGIO, POLL_IN); // Send apps notice of change
+ kill_fasync(&j->async_queue, SIGIO, POLL_IN); // Send apps notice of change
}
}
@@ -1045,8 +1040,6 @@ int ixj_open(struct phone_device *p, struct file *file_p)
if (file_p->f_mode & FMODE_WRITE)
j->writers++;
- MOD_INC_USE_COUNT;
-
if (ixjdebug > 0)
// printk(KERN_INFO "Opening board %d\n", NUM(inode->i_rdev));
printk(KERN_INFO "Opening board %d\n", p->board);
@@ -1196,7 +1189,6 @@ int ixj_release(struct inode *inode, struct file *file_p)
j->rec_frame_size = j->play_frame_size = 0;
ixj_fasync(-1, file_p, 0); // remove from list of async notification
- MOD_DEC_USE_COUNT;
return 0;
}
@@ -1471,8 +1463,7 @@ static void ixj_read_frame(int board)
wake_up_interruptible(&j->poll_q); // Wake any blocked selects
- if (j->async_queue)
- kill_fasync(j->async_queue, SIGIO, POLL_IN); // Send apps notice of frame
+ kill_fasync(&j->async_queue, SIGIO, POLL_IN); // Send apps notice of frame
}
}
@@ -1557,8 +1548,7 @@ static void ixj_write_frame(int board)
wake_up_interruptible(&j->poll_q); // Wake any blocked selects
- if (j->async_queue)
- kill_fasync(j->async_queue, SIGIO, POLL_IN); // Send apps notice of empty buffer
+ kill_fasync(&j->async_queue, SIGIO, POLL_IN); // Send apps notice of empty buffer
#ifdef PERFMON_STATS
++j->frameswritten;
#endif
@@ -3949,6 +3939,7 @@ static int ixj_fasync(int fd, struct file *file_p, int mode)
struct file_operations ixj_fops =
{
+ owner: THIS_MODULE,
read: ixj_enhanced_read,
write: ixj_enhanced_write,
poll: ixj_poll,
@@ -4615,10 +4606,12 @@ int __init ixj_init(void)
pci = pci_find_device(0x15E2, 0x0500, pci);
if (!pci)
break;
+ if (pci_enable_device(pci))
+ break;
{
- ixj[cnt].DSPbase = pci->resource[0].start;
+ ixj[cnt].DSPbase = pci_resource_start(pci, 0);
ixj[cnt].XILINXbase = ixj[cnt].DSPbase + 0x10;
- ixj[cnt].serial = PCIEE_GetSerialNumber(pci->resource[2].start);
+ ixj[cnt].serial = (PCIEE_GetSerialNumber)pci_resource_start(pci, 2);
result = check_region(ixj[cnt].DSPbase, 16);
if (result) {
diff --git a/drivers/telephony/ixj.h b/drivers/telephony/ixj.h
index 3559cc5c0..d88013c2f 100644
--- a/drivers/telephony/ixj.h
+++ b/drivers/telephony/ixj.h
@@ -879,6 +879,7 @@ typedef struct {
typedef struct {
struct phone_device p;
+ struct semaphore mutex;
unsigned int board;
unsigned int DSPbase;
unsigned int XILINXbase;
diff --git a/drivers/telephony/phonedev.c b/drivers/telephony/phonedev.c
index fc4f61b34..3fde30bfa 100644
--- a/drivers/telephony/phonedev.c
+++ b/drivers/telephony/phonedev.c
@@ -49,6 +49,7 @@ static int phone_open(struct inode *inode, struct file *file)
unsigned int minor = MINOR(inode->i_rdev);
int err = 0;
struct phone_device *p;
+ struct file_operations *old_fops;
if (minor >= PHONE_NUM_DEVICES)
return -ENODEV;
@@ -69,12 +70,15 @@ static int phone_open(struct inode *inode, struct file *file)
goto end;
}
}
- if (p->open) {
+ old_fops = file->f_op;
+ file->f_op = fops_get(p->f_op);
+ if (p->open)
err = p->open(p, file); /* Tell the device it is open */
- if (err)
- goto end;
+ if (err) {
+ fops_put(file->f_op);
+ file->f_op = fops_get(old_fops);
}
- file->f_op = p->f_op;
+ fops_put(old_fops);
end:
up(&phone_lock);
return err;
@@ -129,6 +133,7 @@ void phone_unregister_device(struct phone_device *pfd)
static struct file_operations phone_fops =
{
+ owner: THIS_MODULE,
open: phone_open,
};