tty: make ops struct not a pointer

Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
Michael Shaw 2026-07-11 23:54:48 -04:00
commit f177a8e65d
2 changed files with 4 additions and 4 deletions

View file

@ -17,19 +17,19 @@ struct tty *tty_create(const char *name, void *priv)
tty->dev = tty_device; tty->dev = tty_device;
tty->priv = priv; tty->priv = priv;
tty->serial_ops = &arch_serial_ops; tty->serial_ops = arch_serial_ops;
return tty; return tty;
} }
void tty_putchar(struct tty *tty, char c) void tty_putchar(struct tty *tty, char c)
{ {
tty->serial_ops->serial_putchar(tty, c); tty->serial_ops.serial_putchar(tty, c);
} }
char tty_getchar(struct tty *tty) char tty_getchar(struct tty *tty)
{ {
return tty->serial_ops->serial_getchar(tty); return tty->serial_ops.serial_getchar(tty);
} }
void tty_write(struct tty *tty, const char *s) void tty_write(struct tty *tty, const char *s)

View file

@ -12,7 +12,7 @@ struct tty_serial_ops {
struct tty { struct tty {
dev_t dev; dev_t dev;
void *priv; void *priv;
struct tty_serial_ops *serial_ops; struct tty_serial_ops serial_ops;
}; };
void tty_layer_init(); void tty_layer_init();