summaryrefslogtreecommitdiff
path: root/drivers/dahdi/dahdi-base.c
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2010-09-20 20:33:47 +0000
committerShaun Ruffell <sruffell@digium.com>2010-09-20 20:33:47 +0000
commit7bc50ef29028bd16aa756843f5833264d31d5d72 (patch)
tree9240a9244824e42cc545a91e9be60f863cc3235f /drivers/dahdi/dahdi-base.c
parent33e5833c5135c231330c5b617caca674e4af0df0 (diff)
dahdi: dahdi_specchan_open also does not need the unit parameter.
Review: https://reviewboard.asterisk.org/r/905/ Signed-off-by: Shaun Ruffell <sruffell@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9372 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/dahdi-base.c')
-rw-r--r--drivers/dahdi/dahdi-base.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index 506021d..edcae00 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -2776,10 +2776,10 @@ static int dahdi_timer_release(struct file *file)
return 0;
}
-static int dahdi_specchan_open(struct file *file, int unit)
+static int dahdi_specchan_open(struct file *file)
{
int res = 0;
- struct dahdi_chan *const chan = chans[unit];
+ struct dahdi_chan *const chan = chan_from_file(file);
if (chan && chan->sig) {
/* Make sure we're not already open, a net device, or a slave device */
@@ -2936,12 +2936,12 @@ static int dahdi_open(struct inode *inode, struct file *file)
chan = dahdi_alloc_pseudo();
if (chan) {
file->private_data = chan;
- return dahdi_specchan_open(file, chan->channo);
+ return dahdi_specchan_open(file);
} else {
return -ENXIO;
}
}
- return dahdi_specchan_open(file, unit);
+ return dahdi_specchan_open(file);
}
#if 0
@@ -6044,7 +6044,8 @@ static int dahdi_prechan_ioctl(struct file *file, unsigned int cmd, unsigned lon
return -EINVAL;
if (channo > DAHDI_MAX_CHANNELS)
return -EINVAL;
- res = dahdi_specchan_open(file, channo);
+ file->private_data = chans[channo];
+ res = dahdi_specchan_open(file);
if (!res) {
/* Setup the pointer for future stuff */
chan = chans[channo];