From 74b471726593cf7f113774bbf7a00c9c7a274ad8 Mon Sep 17 00:00:00 2001 From: kpfleming Date: Wed, 21 Feb 2007 04:25:21 +0000 Subject: fix up some compiler warnings when building for 2.4 kernels git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@2188 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- zaptel-base.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'zaptel-base.c') diff --git a/zaptel-base.c b/zaptel-base.c index 1391335..7108a9d 100644 --- a/zaptel-base.c +++ b/zaptel-base.c @@ -2340,26 +2340,30 @@ static void zt_free_pseudo(struct zt_chan *pseudo) static int zt_open(struct inode *inode, struct file *file) { int unit = UNIT(file); - int ret = -ENXIO; struct zt_chan *chan; + /* Minor 0: Special "control" descriptor */ if (!unit) return zt_ctl_open(inode, file); + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) if (unit == 250) { if (!zt_transcode_fops) request_module("zttranscode"); if (zt_transcode_fops && zt_transcode_fops->open) { if (try_module_get(zt_transcode_fops->owner)) { + int ret; + ret = zt_transcode_fops->open(inode, file); if (ret) module_put(zt_transcode_fops->owner); + return ret; } - return ret; } return -ENXIO; } #endif + if (unit == 253) { if (maxspans) { return zt_timing_open(inode, file); @@ -6166,11 +6170,13 @@ zt_chan_poll(struct file *file, struct poll_table_struct *wait_table, int unit) static int zt_mmap(struct file *file, struct vm_area_struct *vm) { - int unit = UNIT(file); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) + int unit = UNIT(file); + if (unit == 250) return zt_transcode_fops->mmap(file, vm); #endif + return -ENOSYS; } -- cgit v1.2.3