mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rodolfo Giometti <giometti@linux.it>
To: linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Dave Jones <davej@redhat.com>, Sam Ravnborg <sam@ravnborg.org>,
	Greg KH <greg@kroah.com>, Randy Dunlap <randy.dunlap@oracle.com>,
	Kay Sievers <kay.sievers@vrfy.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	"H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@elte.hu>,
	Michael Kerrisk <mtk.manpages@gmail.com>,
	Christoph Hellwig <hch@infradead.org>,
	Alexander Gordeev <lasaine@lvk.cs.msu.su>,
	Rodolfo Giometti <giometti@linux.it>
Subject: [PATCH 5/8] ldisc n_tty: add new method n_tty_inherit_ops()
Date: Tue, 16 Feb 2010 10:51:22 +0100	[thread overview]
Message-ID: <1266313885-1195-6-git-send-email-giometti@linux.it> (raw)
In-Reply-To: <1266313885-1195-5-git-send-email-giometti@linux.it>

This new method can be used to init a new struct tty_ldisc_ops as the
default tty_ldisc_N_TTY struct.

Signed-off-by: Rodolfo Giometti <giometti@linux.it>
---
 drivers/char/n_tty.c |    9 +++++++++
 include/linux/tty.h  |    1 +
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c
index 2e50f4d..0f11375 100644
--- a/drivers/char/n_tty.c
+++ b/drivers/char/n_tty.c
@@ -48,6 +48,7 @@
 #include <linux/audit.h>
 #include <linux/file.h>
 #include <linux/uaccess.h>
+#include <linux/module.h>
 
 #include <asm/system.h>
 
@@ -2091,3 +2092,11 @@ struct tty_ldisc_ops tty_ldisc_N_TTY = {
 	.receive_buf     = n_tty_receive_buf,
 	.write_wakeup    = n_tty_write_wakeup
 };
+
+void n_tty_inherit_ops(struct tty_ldisc_ops *ops)
+{
+	*ops = tty_ldisc_N_TTY;
+	ops->owner = NULL;
+	ops->refcount = ops->flags = 0;
+}
+EXPORT_SYMBOL_GPL(n_tty_inherit_ops);
diff --git a/include/linux/tty.h b/include/linux/tty.h
index f0f43d0..5091438 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -485,6 +485,7 @@ extern void tty_ldisc_enable(struct tty_struct *tty);
 
 /* n_tty.c */
 extern struct tty_ldisc_ops tty_ldisc_N_TTY;
+extern void n_tty_inherit_ops(struct tty_ldisc_ops *ops);
 
 /* tty_audit.c */
 #ifdef CONFIG_AUDIT
-- 
1.6.3.3


  reply	other threads:[~2010-02-16  9:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-16  9:51 LinuxPPS new functionalities Rodolfo Giometti
2010-02-16  9:51 ` [PATCH 1/8] pps: userland header file for PPS API Rodolfo Giometti
2010-02-16  9:51   ` [PATCH 2/8] pps: documentation programs and examples Rodolfo Giometti
2010-02-16  9:51     ` [PATCH 3/8] pps: LinuxPPS clients support Rodolfo Giometti
2010-02-16  9:51       ` [PATCH 4/8] ldisc: new dcd_change() method for line disciplines Rodolfo Giometti
2010-02-16  9:51         ` Rodolfo Giometti [this message]
2010-02-16  9:51           ` [PATCH 6/8] pps: serial clients support Rodolfo Giometti
2010-02-16  9:51             ` [PATCH 7/8] serial 8250: enable PPS support Rodolfo Giometti
2010-02-16  9:51               ` [PATCH 8/8] serial amba-pl010: " Rodolfo Giometti
2010-02-19 21:53             ` [PATCH 6/8] pps: serial clients support Andrew Morton
2010-02-21 19:21               ` Rodolfo Giometti
2010-02-19 21:45           ` [PATCH 5/8] ldisc n_tty: add new method n_tty_inherit_ops() Andrew Morton
2010-02-16 12:44     ` [PATCH 2/8] pps: documentation programs and examples Alexander Gordeev
2010-02-16 13:56       ` Rodolfo Giometti
2010-02-16 12:33   ` [PATCH 1/8] pps: userland header file for PPS API Alexander Gordeev
2010-02-16 13:53     ` Rodolfo Giometti
2010-02-16 12:28 ` LinuxPPS new functionalities Alan Cox

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=1266313885-1195-6-git-send-email-giometti@linux.it \
    --to=giometti@linux.it \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=davej@redhat.com \
    --cc=dwmw2@infradead.org \
    --cc=greg@kroah.com \
    --cc=hch@infradead.org \
    --cc=hpa@zytor.com \
    --cc=kay.sievers@vrfy.org \
    --cc=lasaine@lvk.cs.msu.su \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mtk.manpages@gmail.com \
    --cc=randy.dunlap@oracle.com \
    --cc=sam@ravnborg.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

Powered by JetHome