TTY: devpts, do not set driver_data

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.

Now driver_data are managed only in the pty driver. devpts_pty_new is
switched to accept what we used to dig out of tty_struct, i.e. device
node number and index.

This also removes a note about driver_data being set outside of the
driver.

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>
This commit is contained in:
Jiri Slaby
2012-10-18 22:26:29 +02:00
committed by Greg Kroah-Hartman
parent 162b97cfa2
commit f11afb6124
3 changed files with 16 additions and 24 deletions

View File

@@ -20,11 +20,12 @@
int devpts_new_index(struct inode *ptmx_inode);
void devpts_kill_index(struct inode *ptmx_inode, int idx);
/* mknod in devpts */
struct inode *devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty);
struct inode *devpts_pty_new(struct inode *ptmx_inode, dev_t device, int index,
void *priv);
/* get private structure */
void *devpts_get_priv(struct inode *pts_inode);
/* unlink */
void devpts_pty_kill(struct tty_struct *tty);
void devpts_pty_kill(struct inode *inode);
#else
@@ -32,7 +33,7 @@ void devpts_pty_kill(struct tty_struct *tty);
static inline int devpts_new_index(struct inode *ptmx_inode) { return -EINVAL; }
static inline void devpts_kill_index(struct inode *ptmx_inode, int idx) { }
static inline struct inode *devpts_pty_new(struct inode *ptmx_inode,
struct tty_struct *tty)
dev_t device, int index, void *priv)
{
return ERR_PTR(-EINVAL);
}
@@ -40,7 +41,7 @@ static inline void *devpts_get_priv(struct inode *pts_inode)
{
return NULL;
}
static inline void devpts_pty_kill(struct tty_struct *tty) { }
static inline void devpts_pty_kill(struct inode *inode) { }
#endif