diff options
Diffstat (limited to 'zaptel-base.c')
-rw-r--r-- | zaptel-base.c | 12 |
1 files changed, 9 insertions, 3 deletions
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; } |