serdev: ttyport: call tiocmget and tiocmset ops directly
authorJohan Hovold <johan@kernel.org>
Wed, 30 Jan 2019 09:52:03 +0000 (10:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Jan 2019 10:48:08 +0000 (11:48 +0100)
The tty struct holds a pointer to the driver's tty operations so drop
the unnecessary driver dereference when calling tiocmget and tiocmset.

Note that this also makes the calls match the preceding sanity checks as
expected.

Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serdev/serdev-ttyport.c

index fa16729..d1cdd2a 100644 (file)
@@ -233,7 +233,7 @@ static int ttyport_get_tiocm(struct serdev_controller *ctrl)
        if (!tty->ops->tiocmget)
                return -ENOTSUPP;
 
-       return tty->driver->ops->tiocmget(tty);
+       return tty->ops->tiocmget(tty);
 }
 
 static int ttyport_set_tiocm(struct serdev_controller *ctrl, unsigned int set, unsigned int clear)
@@ -244,7 +244,7 @@ static int ttyport_set_tiocm(struct serdev_controller *ctrl, unsigned int set, u
        if (!tty->ops->tiocmset)
                return -ENOTSUPP;
 
-       return tty->driver->ops->tiocmset(tty, set, clear);
+       return tty->ops->tiocmset(tty, set, clear);
 }
 
 static const struct serdev_controller_ops ctrl_ops = {