summaryrefslogtreecommitdiff
path: root/drivers/tty/serdev
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2017-05-18 17:33:00 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-05-18 17:38:24 +0200
commit8cde11b2baa1d02eb2eb955dfd47d9f2a12f12cf (patch)
treefbe1c16cdebe360663da4943753be96e87c5a193 /drivers/tty/serdev
parent6bdc00d01e202ae11fa1cae0dacbef895434483d (diff)
tty/serdev: add serdev registration interface
Add a new interface for registering a serdev controller and clients, and a helper function to deregister serdev devices (or a tty device) that were previously registered using the new interface. Once every driver currently using the tty_port_register_device() helpers have been vetted and converted to use the new serdev registration interface (at least for deregistration), we can move serdev registration to the current helpers and get rid of the serdev-specific functions. Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serdev')
-rw-r--r--drivers/tty/serdev/serdev-ttyport.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c
index 013efffd2e82..d0a021c93986 100644
--- a/drivers/tty/serdev/serdev-ttyport.c
+++ b/drivers/tty/serdev/serdev-ttyport.c
@@ -250,16 +250,18 @@ err_reset_data:
return ERR_PTR(ret);
}
-void serdev_tty_port_unregister(struct tty_port *port)
+int serdev_tty_port_unregister(struct tty_port *port)
{
struct serdev_controller *ctrl = port->client_data;
struct serport *serport = serdev_controller_get_drvdata(ctrl);
if (!serport)
- return;
+ return -ENODEV;
serdev_controller_remove(ctrl);
port->client_ops = NULL;
port->client_data = NULL;
serdev_controller_put(ctrl);
+
+ return 0;
}