From 7bc50ef29028bd16aa756843f5833264d31d5d72 Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Mon, 20 Sep 2010 20:33:47 +0000 Subject: dahdi: dahdi_specchan_open also does not need the unit parameter. Review: https://reviewboard.asterisk.org/r/905/ Signed-off-by: Shaun Ruffell git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9372 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/dahdi-base.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'drivers/dahdi/dahdi-base.c') 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]; -- cgit v1.2.3