Skip to content

Commit

Permalink
tty: make tty_set_operations an inline
Browse files Browse the repository at this point in the history
Since commit f34d7a5 (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>
Link: https://lore.kernel.org/r/20210723074317.32690-7-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Jiri Slaby authored and Greg Kroah-Hartman committed Jul 27, 2021
1 parent 56ec588 commit cb9ea61
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
7 changes: 0 additions & 7 deletions drivers/tty/tty_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 6 additions & 2 deletions include/linux/tty_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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

Expand Down

0 comments on commit cb9ea61

Please sign in to comment.