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 17/17] proc tty: remove struct tty_operations::read_proc
Date: Thu, 29 Jan 2009 20:55:49 +0300	[thread overview]
Message-ID: <20090129175549.GQ21643@x200.localdomain> (raw)
In-Reply-To: <20090129174830.GA21643@x200.localdomain>

struct tty_operations::proc_fops took it's place and there is one less
create_proc_read_entry() user now!

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---
 drivers/isdn/capi/capi.c   |    7 -------
 fs/proc/proc_tty.c         |   21 ++++++---------------
 include/linux/tty_driver.h |    2 --
 net/bluetooth/rfcomm/tty.c |    6 ------
 4 files changed, 6 insertions(+), 30 deletions(-)

diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
index 1b5bf87..8506cc5 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -1331,12 +1331,6 @@ static void capinc_tty_send_xchar(struct tty_struct *tty, char ch)
 #endif
 }
 
-static int capinc_tty_read_proc(char *page, char **start, off_t off,
-				int count, int *eof, void *data)
-{
-	return 0;
-}
-
 static struct tty_driver *capinc_tty_driver;
 
 static const struct tty_operations capinc_ops = {
@@ -1358,7 +1352,6 @@ static const struct tty_operations capinc_ops = {
 	.flush_buffer = capinc_tty_flush_buffer,
 	.set_ldisc = capinc_tty_set_ldisc,
 	.send_xchar = capinc_tty_send_xchar,
-	.read_proc = capinc_tty_read_proc,
 };
 
 static int capinc_tty_init(void)
diff --git a/fs/proc/proc_tty.c b/fs/proc/proc_tty.c
index 2b72dbf..f1d4eb8 100644
--- a/fs/proc/proc_tty.c
+++ b/fs/proc/proc_tty.c
@@ -144,23 +144,14 @@ void proc_tty_register_driver(struct tty_driver *driver)
 {
 	struct proc_dir_entry *ent;
 		
-	if (!driver->driver_name || driver->proc_entry)
+	if (!driver->driver_name || driver->proc_entry ||
+	    !driver->ops->proc_fops)
 		return;
 
-	if (driver->ops->proc_fops) {
-		ent = proc_create_data(driver->driver_name, 0, proc_tty_driver,
-				       driver->ops->proc_fops, driver);
-		if (!ent)
-			return;
-	} else if (driver->ops->read_proc) {
-		ent = create_proc_entry(driver->driver_name, 0, proc_tty_driver);
-		if (!ent)
-			return;
-		ent->read_proc = driver->ops->read_proc;
-		ent->data = driver;
-	} else
-		return;
-	ent->owner = driver->owner;
+	ent = proc_create_data(driver->driver_name, 0, proc_tty_driver,
+			       driver->ops->proc_fops, driver);
+	if (ent)
+		ent->owner = driver->owner;
 
 	driver->proc_entry = ent;
 }
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index c9a6957..8615d66 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -252,8 +252,6 @@ struct tty_operations {
 	void (*set_ldisc)(struct tty_struct *tty);
 	void (*wait_until_sent)(struct tty_struct *tty, int timeout);
 	void (*send_xchar)(struct tty_struct *tty, char ch);
-	int (*read_proc)(char *page, char **start, off_t off,
-			  int count, int *eof, void *data);
 	int (*tiocmget)(struct tty_struct *tty, struct file *file);
 	int (*tiocmset)(struct tty_struct *tty, struct file *file,
 			unsigned int set, unsigned int clear);
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
index d030c69..58a653e 100644
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
@@ -1092,11 +1092,6 @@ static void rfcomm_tty_hangup(struct tty_struct *tty)
 	}
 }
 
-static int rfcomm_tty_read_proc(char *buf, char **start, off_t offset, int len, int *eof, void *unused)
-{
-	return 0;
-}
-
 static int rfcomm_tty_tiocmget(struct tty_struct *tty, struct file *filp)
 {
 	struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data;
@@ -1155,7 +1150,6 @@ static const struct tty_operations rfcomm_ops = {
 	.send_xchar		= rfcomm_tty_send_xchar,
 	.hangup			= rfcomm_tty_hangup,
 	.wait_until_sent	= rfcomm_tty_wait_until_sent,
-	.read_proc		= rfcomm_tty_read_proc,
 	.tiocmget		= rfcomm_tty_tiocmget,
 	.tiocmset		= rfcomm_tty_tiocmset,
 };
-- 
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 ` [PATCH 16/17] proc tty: switch xtensa iss console " Alexey Dobriyan
2009-01-29 17:55 ` Alexey Dobriyan [this message]

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=20090129175549.GQ21643@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).