summaryrefslogtreecommitdiffstats
path: root/include/linux/serdev.h
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2017-05-18 11:33:00 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-05-18 11:38:24 -0400
commit8cde11b2baa1d02eb2eb955dfd47d9f2a12f12cf (patch)
treefbe1c16cdebe360663da4943753be96e87c5a193 /include/linux/serdev.h
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 'include/linux/serdev.h')
-rw-r--r--include/linux/serdev.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/serdev.h b/include/linux/serdev.h
index e2a225bf716d..e69402d4a8ae 100644
--- a/include/linux/serdev.h
+++ b/include/linux/serdev.h
@@ -308,7 +308,7 @@ struct tty_driver;
308struct device *serdev_tty_port_register(struct tty_port *port, 308struct device *serdev_tty_port_register(struct tty_port *port,
309 struct device *parent, 309 struct device *parent,
310 struct tty_driver *drv, int idx); 310 struct tty_driver *drv, int idx);
311void serdev_tty_port_unregister(struct tty_port *port); 311int serdev_tty_port_unregister(struct tty_port *port);
312#else 312#else
313static inline struct device *serdev_tty_port_register(struct tty_port *port, 313static inline struct device *serdev_tty_port_register(struct tty_port *port,
314 struct device *parent, 314 struct device *parent,
@@ -316,7 +316,10 @@ static inline struct device *serdev_tty_port_register(struct tty_port *port,
316{ 316{
317 return ERR_PTR(-ENODEV); 317 return ERR_PTR(-ENODEV);
318} 318}
319static inline void serdev_tty_port_unregister(struct tty_port *port) {} 319static inline int serdev_tty_port_unregister(struct tty_port *port)
320{
321 return -ENODEV;
322}
320#endif /* CONFIG_SERIAL_DEV_CTRL_TTYPORT */ 323#endif /* CONFIG_SERIAL_DEV_CTRL_TTYPORT */
321 324
322#endif /*_LINUX_SERDEV_H */ 325#endif /*_LINUX_SERDEV_H */