dtlk.c (2d8ad8719591fa803b0d589ed057fa46f49b7155) | dtlk.c (496ad9aa8ef448058e36ca7a787c61f2e63f0f54) |
---|---|
1/* -*- linux-c -*- 2 * dtlk.c - DoubleTalk PC driver for Linux 3 * 4 * Original author: Chris Pallotta <chris@allmedia.com> 5 * Current maintainer: Jim Van Zandt <jrv@vanzandt.mv.com> 6 * 7 * 2000-03-18 Jim Van Zandt: Fix polling. 8 * Eliminate dtlk_timer_active flag and separate dtlk_stop_timer --- 111 unchanged lines hidden (view full) --- 120static char dtlk_write_tts(char); 121/* 122 static void dtlk_handle_error(char, char, unsigned int); 123 */ 124 125static ssize_t dtlk_read(struct file *file, char __user *buf, 126 size_t count, loff_t * ppos) 127{ | 1/* -*- linux-c -*- 2 * dtlk.c - DoubleTalk PC driver for Linux 3 * 4 * Original author: Chris Pallotta <chris@allmedia.com> 5 * Current maintainer: Jim Van Zandt <jrv@vanzandt.mv.com> 6 * 7 * 2000-03-18 Jim Van Zandt: Fix polling. 8 * Eliminate dtlk_timer_active flag and separate dtlk_stop_timer --- 111 unchanged lines hidden (view full) --- 120static char dtlk_write_tts(char); 121/* 122 static void dtlk_handle_error(char, char, unsigned int); 123 */ 124 125static ssize_t dtlk_read(struct file *file, char __user *buf, 126 size_t count, loff_t * ppos) 127{ |
128 unsigned int minor = iminor(file->f_path.dentry->d_inode); | 128 unsigned int minor = iminor(file_inode(file)); |
129 char ch; 130 int i = 0, retries; 131 132 TRACE_TEXT("(dtlk_read"); 133 /* printk("DoubleTalk PC - dtlk_read()\n"); */ 134 135 if (minor != DTLK_MINOR || !dtlk_has_indexing) 136 return -EINVAL; --- 35 unchanged lines hidden (view full) --- 172 printk("%c", ch); 173 else 174 printk("\\%03o", ch); 175 } 176 printk("\""); 177 } 178#endif 179 | 129 char ch; 130 int i = 0, retries; 131 132 TRACE_TEXT("(dtlk_read"); 133 /* printk("DoubleTalk PC - dtlk_read()\n"); */ 134 135 if (minor != DTLK_MINOR || !dtlk_has_indexing) 136 return -EINVAL; --- 35 unchanged lines hidden (view full) --- 172 printk("%c", ch); 173 else 174 printk("\\%03o", ch); 175 } 176 printk("\""); 177 } 178#endif 179 |
180 if (iminor(file->f_path.dentry->d_inode) != DTLK_MINOR) | 180 if (iminor(file_inode(file)) != DTLK_MINOR) |
181 return -EINVAL; 182 183 while (1) { 184 while (i < count && !get_user(ch, buf) && 185 (ch == DTLK_CLEAR || dtlk_writeable())) { 186 dtlk_write_tts(ch); 187 buf++; 188 i++; --- 475 unchanged lines hidden --- | 181 return -EINVAL; 182 183 while (1) { 184 while (i < count && !get_user(ch, buf) && 185 (ch == DTLK_CLEAR || dtlk_writeable())) { 186 dtlk_write_tts(ch); 187 buf++; 188 i++; --- 475 unchanged lines hidden --- |