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 3/6] ldisc n_tty: add new method n_tty_inherit_ops()
Date: Tue, 23 Feb 2010 13:40:32 +0100 [thread overview]
Message-ID: <1266928835-5435-4-git-send-email-giometti@linux.it> (raw)
In-Reply-To: <1266928835-5435-3-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 | 17 +++++++++++++++++
include/linux/tty.h | 1 +
2 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c
index 2e50f4d..bdae832 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,19 @@ struct tty_ldisc_ops tty_ldisc_N_TTY = {
.receive_buf = n_tty_receive_buf,
.write_wakeup = n_tty_write_wakeup
};
+
+/**
+ * n_tty_inherit_ops - inherit N_TTY methods
+ * @ops: struct tty_ldisc_ops where to save N_TTY methods
+ *
+ * Used by a generic struct tty_ldisc_ops to easily inherit N_TTY
+ * methods.
+ */
+
+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 6abfcf5..d6cc652 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -504,6 +504,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
next prev parent reply other threads:[~2010-02-23 12:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-23 12:40 (version 2) LinuxPPS new functionalities Rodolfo Giometti
2010-02-23 12:40 ` [PATCH 1/6] pps: LinuxPPS clients support Rodolfo Giometti
2010-02-23 12:40 ` [PATCH 2/6] ldisc: new dcd_change() method for line disciplines Rodolfo Giometti
2010-02-23 12:40 ` Rodolfo Giometti [this message]
2010-02-23 12:40 ` [PATCH 4/6] pps: serial clients support Rodolfo Giometti
2010-02-23 12:40 ` [PATCH 5/6] serial 8250: enable PPS support Rodolfo Giometti
2010-02-23 12:40 ` [PATCH 6/6] serial amba-pl010: " Rodolfo Giometti
2010-02-23 16:21 ` [PATCH 1/6] pps: LinuxPPS clients support Randy Dunlap
-- strict thread matches above, loose matches on Subject: below --
2010-02-25 12:41 (version 3) LinuxPPS new functionalities Rodolfo Giometti
2010-02-25 12:41 ` [PATCH 1/6] pps: LinuxPPS clients support Rodolfo Giometti
2010-02-25 12:41 ` [PATCH 2/6] ldisc: new dcd_change() method for line disciplines Rodolfo Giometti
2010-02-25 12:41 ` [PATCH 3/6] ldisc n_tty: add new method n_tty_inherit_ops() Rodolfo Giometti
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=1266928835-5435-4-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.