diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-08-16 16:16:56 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-08-16 12:07:23 -0700 |
commit | c3a6344ae475763b6fb0fb2ec3639004f500d0f1 (patch) | |
tree | 3279f1e5f5651d322a2177da2108f465bd9c194d /drivers/char | |
parent | 88ed2a60610974443335c924d7cb8e5dcf9dbdc1 (diff) | |
download | talos-obmc-linux-c3a6344ae475763b6fb0fb2ec3639004f500d0f1.tar.gz talos-obmc-linux-c3a6344ae475763b6fb0fb2ec3639004f500d0f1.zip |
TTY: tty_alloc_driver() returns error pointers
We changed these from alloc_tty_driver() to tty_alloc_driver() so the
error handling needs to modified to check for IS_ERR() instead of NULL.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/pcmcia/synclink_cs.c | 4 | ||||
-rw-r--r-- | drivers/char/ttyprintk.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index d9335ae1fadf..5db08c78beb5 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c @@ -2813,8 +2813,8 @@ static int __init synclink_cs_init(void) serial_driver = tty_alloc_driver(MAX_DEVICE_COUNT, TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV); - if (!serial_driver) { - rc = -ENOMEM; + if (IS_ERR(serial_driver)) { + rc = PTR_ERR(serial_driver); goto err; } diff --git a/drivers/char/ttyprintk.c b/drivers/char/ttyprintk.c index 561f8aa7cd87..af98f6d6509b 100644 --- a/drivers/char/ttyprintk.c +++ b/drivers/char/ttyprintk.c @@ -187,8 +187,8 @@ static int __init ttyprintk_init(void) TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW | TTY_DRIVER_UNNUMBERED_NODE); - if (!ttyprintk_driver) - return ret; + if (IS_ERR(ttyprintk_driver)) + return PTR_ERR(ttyprintk_driver); ttyprintk_driver->driver_name = "ttyprintk"; ttyprintk_driver->name = "ttyprintk"; |