linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 16/17] proc tty: switch xtensa iss console to ->proc_fops
Date: Thu, 29 Jan 2009 20:55:30 +0300	[thread overview]
Message-ID: <20090129175530.GP21643@x200.localdomain> (raw)
In-Reply-To: <20090129174830.GA21643@x200.localdomain>

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---
 arch/xtensa/platforms/iss/console.c |   29 ++++++++++++++++-------------
 1 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/arch/xtensa/platforms/iss/console.c b/arch/xtensa/platforms/iss/console.c
index efed889..5a2db68 100644
--- a/arch/xtensa/platforms/iss/console.c
+++ b/arch/xtensa/platforms/iss/console.c
@@ -18,6 +18,7 @@
 #include <linux/mm.h>
 #include <linux/major.h>
 #include <linux/param.h>
+#include <linux/seq_file.h>
 #include <linux/serial.h>
 #include <linux/serialP.h>
 
@@ -178,22 +179,24 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
 	/* Stub, once again.. */
 }
 
-static int rs_read_proc(char *page, char **start, off_t off, int count,
-			int *eof, void *data)
+static int rs_proc_show(struct seq_file *m, void *v)
 {
-	int len = 0;
-	off_t begin = 0;
-
-	len += sprintf(page, "serinfo:1.0 driver:%s\n", serial_version);
-	*eof = 1;
-
-	if (off >= len + begin)
-		return 0;
+	seq_printf(m, "serinfo:1.0 driver:%s\n", serial_version);
+	return 0;
+}
 
-	*start = page + (off - begin);
-	return ((count < begin + len - off) ? count : begin + len - off);
+static int rs_proc_open(struct inode *inode, struct file *file)
+{
+	return single_open(file, rs_proc_show, NULL);
 }
 
+static const struct file_operations rs_proc_fops = {
+	.owner		= THIS_MODULE,
+	.open		= rs_proc_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= single_release,
+};
 
 static struct tty_operations serial_ops = {
 	.open = rs_open,
@@ -205,7 +208,7 @@ static struct tty_operations serial_ops = {
 	.chars_in_buffer = rs_chars_in_buffer,
 	.hangup = rs_hangup,
 	.wait_until_sent = rs_wait_until_sent,
-	.read_proc = rs_read_proc
+	.proc_fops = &rs_proc_fops,
 };
 
 int __init rs_init(void)
-- 
1.5.6.5


  parent reply	other threads:[~2009-01-29 17:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-29 17:48 [PATCH 01/17] proc tty: add struct tty_operations::proc_fops Alexey Dobriyan
2009-01-29 17:49 ` [PATCH 02/17] proc tty: switch cyclades to ->proc_fops Alexey Dobriyan
2009-01-29 17:49 ` [PATCH 03/17] proc tty: switch ip2 " Alexey Dobriyan
2009-01-29 17:49 ` [PATCH 04/17] proc tty: switch istallion " Alexey Dobriyan
2009-01-29 17:50 ` [PATCH 05/17] proc tty: switch synclink_cs " Alexey Dobriyan
2009-01-29 17:50 ` [PATCH 06/17] proc tty: switch stallion " Alexey Dobriyan
2009-01-29 17:50 ` [PATCH 07/17] proc tty: switch synclink " Alexey Dobriyan
2009-01-29 17:51 ` [PATCH 08/17] proc tty: switch synclink_gt " Alexey Dobriyan
2009-01-29 17:51 ` [PATCH 09/17] proc tty: switch synclinkmp " Alexey Dobriyan
2009-01-29 17:53 ` [PATCH 10/17] proc tty: switch sdio_uart " Alexey Dobriyan
2009-01-29 17:53 ` [PATCH 11/17] proc tty: switch serial_core " Alexey Dobriyan
2009-01-29 17:54 ` [PATCH 12/17] proc tty: switch usb-serial " Alexey Dobriyan
2009-01-29 17:54 ` [PATCH 13/17] proc tty: switch ircomm " Alexey Dobriyan
2009-01-29 17:54 ` [PATCH 14/17] proc tty: switch amiserial " Alexey Dobriyan
2009-01-29 17:55 ` [PATCH 15/17] proc tty: switch ia64 simserial " Alexey Dobriyan
2009-01-29 17:55 ` Alexey Dobriyan [this message]
2009-01-29 17:55 ` [PATCH 17/17] proc tty: remove struct tty_operations::read_proc Alexey Dobriyan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090129175530.GP21643@x200.localdomain \
    --to=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).