[dahdi-commits] sruffell: branch linux/sruffell/chan_list_refactoring r9282 - /linux/team/sru...

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Thu Sep 2 12:41:27 CDT 2010


Author: sruffell
Date: Thu Sep  2 12:41:16 2010
New Revision: 9282

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9282
Log:
dahdi: Remove unit parameter from dahdi_chanandpsuedo_ioctl.

Modified:
    linux/team/sruffell/chan_list_refactoring/drivers/dahdi/dahdi-base.c

Modified: linux/team/sruffell/chan_list_refactoring/drivers/dahdi/dahdi-base.c
URL: http://svnview.digium.com/svn/dahdi/linux/team/sruffell/chan_list_refactoring/drivers/dahdi/dahdi-base.c?view=diff&rev=9282&r1=9281&r2=9282
==============================================================================
--- linux/team/sruffell/chan_list_refactoring/drivers/dahdi/dahdi-base.c (original)
+++ linux/team/sruffell/chan_list_refactoring/drivers/dahdi/dahdi-base.c Thu Sep  2 12:41:16 2010
@@ -5137,9 +5137,9 @@
 
 static int
 dahdi_chanandpseudo_ioctl(struct file *file, unsigned int cmd,
-			  unsigned long data, int unit)
-{
-	struct dahdi_chan *chan = chans[unit];
+			  unsigned long data)
+{
+	struct dahdi_chan *chan = chan_from_file(file);
 	union {
 		struct dahdi_bufferinfo bi;
 		struct dahdi_ring_cadence cad;
@@ -5371,8 +5371,8 @@
 		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);
@@ -5430,7 +5430,7 @@
 		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)
@@ -6025,7 +6025,7 @@
 		break;
 #endif
 	default:
-		return dahdi_chanandpseudo_ioctl(file, cmd, data, chan->channo);
+		return dahdi_chanandpseudo_ioctl(file, cmd, data);
 	}
 	return 0;
 }
@@ -6064,7 +6064,6 @@
 #endif
 {
 	int unit = UNIT(file);
-	struct dahdi_chan *chan;
 	struct dahdi_timer *timer;
 	int ret;
 
@@ -6101,13 +6100,12 @@
 		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;
 	}
 




More information about the dahdi-commits mailing list