aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa/platforms
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2009-03-31 18:19:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-01 11:59:10 -0400
commit140716934f67a9b28c3f7032c07c20c746d97a31 (patch)
tree5086f27e2510ee6151d188c6898fb451b164b246 /arch/xtensa/platforms
parentbf54215ef86a1bd83affd8ecdf833c053aefb49d (diff)
proc tty: switch xtensa iss console to ->proc_fops
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/xtensa/platforms')
-rw-r--r--arch/xtensa/platforms/iss/console.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/arch/xtensa/platforms/iss/console.c b/arch/xtensa/platforms/iss/console.c
index 25d46c84eb08..4c559cf7da2d 100644
--- a/arch/xtensa/platforms/iss/console.c
+++ b/arch/xtensa/platforms/iss/console.c
@@ -18,6 +18,7 @@
18#include <linux/mm.h> 18#include <linux/mm.h>
19#include <linux/major.h> 19#include <linux/major.h>
20#include <linux/param.h> 20#include <linux/param.h>
21#include <linux/seq_file.h>
21#include <linux/serial.h> 22#include <linux/serial.h>
22#include <linux/serialP.h> 23#include <linux/serialP.h>
23 24
@@ -176,22 +177,24 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
176 /* Stub, once again.. */ 177 /* Stub, once again.. */
177} 178}
178 179
179static int rs_read_proc(char *page, char **start, off_t off, int count, 180static int rs_proc_show(struct seq_file *m, void *v)
180 int *eof, void *data)
181{ 181{
182 int len = 0; 182 seq_printf(m, "serinfo:1.0 driver:%s\n", serial_version);
183 off_t begin = 0; 183 return 0;
184 184}
185 len += sprintf(page, "serinfo:1.0 driver:%s\n", serial_version);
186 *eof = 1;
187
188 if (off >= len + begin)
189 return 0;
190 185
191 *start = page + (off - begin); 186static int rs_proc_open(struct inode *inode, struct file *file)
192 return ((count < begin + len - off) ? count : begin + len - off); 187{
188 return single_open(file, rs_proc_show, NULL);
193} 189}
194 190
191static const struct file_operations rs_proc_fops = {
192 .owner = THIS_MODULE,
193 .open = rs_proc_open,
194 .read = seq_read,
195 .llseek = seq_lseek,
196 .release = single_release,
197};
195 198
196static struct tty_operations serial_ops = { 199static struct tty_operations serial_ops = {
197 .open = rs_open, 200 .open = rs_open,
@@ -203,7 +206,7 @@ static struct tty_operations serial_ops = {
203 .chars_in_buffer = rs_chars_in_buffer, 206 .chars_in_buffer = rs_chars_in_buffer,
204 .hangup = rs_hangup, 207 .hangup = rs_hangup,
205 .wait_until_sent = rs_wait_until_sent, 208 .wait_until_sent = rs_wait_until_sent,
206 .read_proc = rs_read_proc 209 .proc_fops = &rs_proc_fops,
207}; 210};
208 211
209int __init rs_init(void) 212int __init rs_init(void)