aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/devpts_fs.h
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2012-10-18 16:26:28 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-22 19:50:12 -0400
commit162b97cfa21f816f39ede1944f2a4220e3cf8969 (patch)
tree6cd663b2b17c3013285148efd43a145d6dea9a5e /include/linux/devpts_fs.h
parent8fcbaa2b7f5b70dba9ed1c7f91d0a270ce752e2c (diff)
TTY: devpts, return created inode from devpts_pty_new
The goal is to stop setting and using tty->driver_data in devpts code. It should be used solely by the driver's code, pty in this case. For the cleanup of layering, we will need the inode created in devpts_pty_new to be stored into slave's driver_data. So we convert devpts_pty_new to return the inode or an ERR_PTR-encoded error in case of failure. The move of 'inode = new_inode(sb);' from declarators to the code is only cosmetical, but it makes the code easier to read. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/devpts_fs.h')
-rw-r--r--include/linux/devpts_fs.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/devpts_fs.h b/include/linux/devpts_fs.h
index de635a5505ea..4ca846f16fe5 100644
--- a/include/linux/devpts_fs.h
+++ b/include/linux/devpts_fs.h
@@ -20,7 +20,7 @@
20int devpts_new_index(struct inode *ptmx_inode); 20int devpts_new_index(struct inode *ptmx_inode);
21void devpts_kill_index(struct inode *ptmx_inode, int idx); 21void devpts_kill_index(struct inode *ptmx_inode, int idx);
22/* mknod in devpts */ 22/* mknod in devpts */
23int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty); 23struct inode *devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty);
24/* get private structure */ 24/* get private structure */
25void *devpts_get_priv(struct inode *pts_inode); 25void *devpts_get_priv(struct inode *pts_inode);
26/* unlink */ 26/* unlink */
@@ -31,10 +31,10 @@ void devpts_pty_kill(struct tty_struct *tty);
31/* Dummy stubs in the no-pty case */ 31/* Dummy stubs in the no-pty case */
32static inline int devpts_new_index(struct inode *ptmx_inode) { return -EINVAL; } 32static inline int devpts_new_index(struct inode *ptmx_inode) { return -EINVAL; }
33static inline void devpts_kill_index(struct inode *ptmx_inode, int idx) { } 33static inline void devpts_kill_index(struct inode *ptmx_inode, int idx) { }
34static inline int devpts_pty_new(struct inode *ptmx_inode, 34static inline struct inode *devpts_pty_new(struct inode *ptmx_inode,
35 struct tty_struct *tty) 35 struct tty_struct *tty)
36{ 36{
37 return -EINVAL; 37 return ERR_PTR(-EINVAL);
38} 38}
39static inline void *devpts_get_priv(struct inode *pts_inode) 39static inline void *devpts_get_priv(struct inode *pts_inode)
40{ 40{