diff options
author | Shaun Ruffell <sruffell@digium.com> | 2010-09-20 20:34:07 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2010-09-20 20:34:07 +0000 |
commit | f0872daa9c5a28478f669cd287fadbe6731fc828 (patch) | |
tree | 5d52f223a65794e730657af21838e3f27ab16b59 /drivers/dahdi/dahdi-base.c | |
parent | 6e8d08a54a82077c2545153d29a355d20039fd4a (diff) |
dahdi: Remove unit parameter from dahdi_chanandpsuedo_ioctl.
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@9377 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/dahdi-base.c')
-rw-r--r-- | drivers/dahdi/dahdi-base.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c index b5538e8..b7be744 100644 --- a/drivers/dahdi/dahdi-base.c +++ b/drivers/dahdi/dahdi-base.c @@ -5145,9 +5145,9 @@ static int dahdi_ioctl_getconf(struct file *file, unsigned long data) static int dahdi_chanandpseudo_ioctl(struct file *file, unsigned int cmd, - unsigned long data, int unit) + unsigned long data) { - struct dahdi_chan *chan = chans[unit]; + struct dahdi_chan *chan = chan_from_file(file); union { struct dahdi_bufferinfo bi; struct dahdi_ring_cadence cad; @@ -5379,8 +5379,8 @@ dahdi_chanandpseudo_ioctl(struct file *file, unsigned int cmd, return dahdi_ioctl_confdiag(file, data); case DAHDI_CHANNO: /* get channel number of stream */ - /* return unit/channel number */ - put_user(unit, (int __user *)data); + /* return channel number */ + put_user(chan->channo, (int __user *)data); break; case DAHDI_SETLAW: get_user(j, (int __user *)data); @@ -5438,7 +5438,7 @@ dahdi_chanandpseudo_ioctl(struct file *file, unsigned int cmd, break; default: /* Check for common ioctl's and private ones */ - rv = dahdi_common_ioctl(file, cmd, data, unit); + rv = dahdi_common_ioctl(file, cmd, data, chan->channo); /* if no span, just return with value */ if (!chan->span) return rv; if ((rv == -ENOTTY) && chan->span->ops->ioctl) @@ -6033,7 +6033,7 @@ static int dahdi_chan_ioctl(struct file *file, unsigned int cmd, unsigned long d break; #endif default: - return dahdi_chanandpseudo_ioctl(file, cmd, data, chan->channo); + return dahdi_chanandpseudo_ioctl(file, cmd, data); } return 0; } @@ -6072,7 +6072,6 @@ static int dahdi_ioctl(struct inode *inode, struct file *file, #endif { int unit = UNIT(file); - struct dahdi_chan *chan; struct dahdi_timer *timer; int ret; @@ -6109,13 +6108,12 @@ static int dahdi_ioctl(struct inode *inode, struct file *file, goto unlock_exit; } if (unit == 255) { - chan = file->private_data; - if (!chan) { + if (!file->private_data) { module_printk(KERN_NOTICE, "No pseudo channel structure to read?\n"); ret = -EINVAL; goto unlock_exit; } - ret = dahdi_chanandpseudo_ioctl(file, cmd, data, chan->channo); + ret = dahdi_chanandpseudo_ioctl(file, cmd, data); goto unlock_exit; } |