All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: gregkh@linuxfoundation.org
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jiri Slaby <jslaby@suse.cz>
Subject: [PATCH 6/8] tty: make tty_set_operations an inline
Date: Fri, 23 Jul 2021 09:43:15 +0200	[thread overview]
Message-ID: <20210723074317.32690-7-jslaby@suse.cz> (raw)
In-Reply-To: <20210723074317.32690-1-jslaby@suse.cz>

Since commit f34d7a5b7010 (tty: The big operations rework) in 2008,
tty_set_operations() is a simple one-line assignment. There is no reason
for this to be an exported function, hence move it to a header and make
an inline from that.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/tty/tty_io.c       | 7 -------
 include/linux/tty_driver.h | 8 ++++++--
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 26debec26b4e..16e3fce6f88d 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -3438,13 +3438,6 @@ void tty_driver_kref_put(struct tty_driver *driver)
 }
 EXPORT_SYMBOL(tty_driver_kref_put);
 
-void tty_set_operations(struct tty_driver *driver,
-			const struct tty_operations *op)
-{
-	driver->ops = op;
-};
-EXPORT_SYMBOL(tty_set_operations);
-
 void put_tty_driver(struct tty_driver *d)
 {
 	tty_driver_kref_put(d);
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index c7746dee58a6..6092ce9180aa 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -330,8 +330,6 @@ extern struct list_head tty_drivers;
 extern struct tty_driver *__tty_alloc_driver(unsigned int lines,
 		struct module *owner, unsigned long flags);
 extern void put_tty_driver(struct tty_driver *driver);
-extern void tty_set_operations(struct tty_driver *driver,
-			const struct tty_operations *op);
 extern struct tty_driver *tty_find_polling_driver(char *name, int *line);
 
 extern void tty_driver_kref_put(struct tty_driver *driver);
@@ -346,6 +344,12 @@ static inline struct tty_driver *tty_driver_kref_get(struct tty_driver *d)
 	return d;
 }
 
+static inline void tty_set_operations(struct tty_driver *driver,
+		const struct tty_operations *op)
+{
+	driver->ops = op;
+}
+
 /* tty driver magic number */
 #define TTY_DRIVER_MAGIC		0x5402
 
-- 
2.32.0


  parent reply	other threads:[~2021-07-23  7:43 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-23  7:43 [PATCH 0/8] Get rid of old tty_driver functions Jiri Slaby
2021-07-23  7:43 ` [PATCH 1/8] xtensa: ISS: don't panic in rs_init Jiri Slaby
2021-07-23 10:18   ` Max Filippov
2021-07-23  7:43 ` [PATCH 2/8] hvsi: don't panic on tty_register_driver failure Jiri Slaby
2021-07-23  7:43   ` Jiri Slaby
2021-07-23  7:43 ` [PATCH 3/8] tty: don't store semi-state into tty drivers Jiri Slaby
2021-07-23 10:23   ` Max Filippov
2021-07-23 16:37   ` Helge Deller
2021-07-23  7:43 ` [PATCH 4/8] tty: stop using alloc_tty_driver Jiri Slaby
2021-07-23  7:49   ` Samuel Iglesias Gonsálvez
2021-07-23  7:57   ` Christian Borntraeger
2021-07-23 10:16   ` David Sterba
2021-07-23 10:30   ` Max Filippov
2021-07-23  7:43 ` [PATCH 5/8] tty: drop alloc_tty_driver Jiri Slaby
2021-07-23  7:43 ` Jiri Slaby [this message]
2021-07-23  7:43 ` [PATCH 7/8] tty: drop put_tty_driver Jiri Slaby
2021-07-23  7:49   ` Samuel Iglesias Gonsálvez
2021-07-23  7:55   ` Christian Borntraeger
2021-07-23 10:16   ` David Sterba
2021-07-23 10:32   ` Max Filippov
2021-07-23 12:50   ` Alex Elder
2021-07-23  7:43 ` [PATCH 8/8] tty: pdc_cons, free tty_driver upon failure Jiri Slaby
2021-07-27 10:18 ` [PATCH 0/8] Get rid of old tty_driver functions Greg KH

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=20210723074317.32690-7-jslaby@suse.cz \
    --to=jslaby@suse.cz \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@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 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.