From 73ec06fc5f5c8e1097a7a4a4ab2d7c6c3a007e81 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Mon, 13 Oct 2008 10:42:29 +0100 Subject: tty: Finish fixing up the init_dev interface to use ERR_PTR Original suggestion and proposal from Sukadev Bhattiprolu. Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds --- drivers/char/pty.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers/char/pty.c') diff --git a/drivers/char/pty.c b/drivers/char/pty.c index 4e6490bda75..c9845002303 100644 --- a/drivers/char/pty.c +++ b/drivers/char/pty.c @@ -501,11 +501,13 @@ static int __ptmx_open(struct inode *inode, struct file *filp) return index; mutex_lock(&tty_mutex); - retval = tty_init_dev(ptm_driver, index, &tty, 1); + tty = tty_init_dev(ptm_driver, index, 1); mutex_unlock(&tty_mutex); - if (retval) + if (IS_ERR(tty)) { + retval = PTR_ERR(tty); goto out; + } set_bit(TTY_PTY_LOCK, &tty->flags); /* LOCK THE SLAVE */ filp->private_data = tty; -- cgit v1.2.3