[svn-commits] sruffell: linux/trunk r9376 - /linux/trunk/drivers/dahdi/dahdi-base.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Sep 20 15:34:07 CDT 2010


Author: sruffell
Date: Mon Sep 20 15:34:03 2010
New Revision: 9376

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9376
Log:
dahdi: Remove unit parameter to dahdi_prechan_ioctl

Review: https://reviewboard.asterisk.org/r/905/

Signed-off-by: Shaun Ruffell <sruffell at digium.com>

Modified:
    linux/trunk/drivers/dahdi/dahdi-base.c

Modified: linux/trunk/drivers/dahdi/dahdi-base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi-base.c?view=diff&rev=9376&r1=9375&r2=9376
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi-base.c (original)
+++ linux/trunk/drivers/dahdi/dahdi-base.c Mon Sep 20 15:34:03 2010
@@ -6038,13 +6038,12 @@
 	return 0;
 }
 
-static int dahdi_prechan_ioctl(struct file *file, unsigned int cmd, unsigned long data, int unit)
-{
-	struct dahdi_chan *chan = file->private_data;
+static int dahdi_prechan_ioctl(struct file *file, unsigned int cmd, unsigned long data)
+{
 	int channo;
 	int res;
 
-	if (chan) {
+	if (file->private_data) {
 		module_printk(KERN_NOTICE, "Huh?  Prechan already has private data??\n");
 	}
 	switch(cmd) {
@@ -6056,13 +6055,8 @@
 			return -EINVAL;
 		file->private_data = chans[channo];
 		res = dahdi_specchan_open(file);
-		if (!res) {
-			/* Setup the pointer for future stuff */
-			chan = chans[channo];
-			file->private_data = chan;
-			/* Return success */
-			return 0;
-		}
+		if (res)
+			file->private_data = NULL;
 		return res;
 	default:
 		return -ENOSYS;
@@ -6108,11 +6102,10 @@
 		goto unlock_exit;
 	}
 	if (unit == 254) {
-		chan = file->private_data;
-		if (chan)
+		if (file->private_data)
 			ret = dahdi_chan_ioctl(file, cmd, data);
 		else
-			ret = dahdi_prechan_ioctl(file, cmd, data, unit);
+			ret = dahdi_prechan_ioctl(file, cmd, data);
 		goto unlock_exit;
 	}
 	if (unit == 255) {




More information about the svn-commits mailing list