summaryrefslogtreecommitdiff
path: root/drivers/tty/vcc.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-08-26 09:12:05 +0300
committerDavid S. Miller <davem@davemloft.net>2017-08-29 01:39:55 +0300
commitc6b4ee9eba97b64750d5e8be31c04b70592592b7 (patch)
tree6e112756f279016f31a68fda3c47f49c839df76c /drivers/tty/vcc.c
parentcc324d1a3e3549203649b54209dd235e723a8f61 (diff)
downloadlinux-c6b4ee9eba97b64750d5e8be31c04b70592592b7.tar.xz
sparc64: vcc: Check for IS_ERR() instead of NULL
The tty_alloc_driver() function never returns NULL, it returns error pointers on error. Fixes: ce808b746325 ("sparc64: vcc: TTY driver initialization and cleanup") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/tty/vcc.c')
-rw-r--r--drivers/tty/vcc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/tty/vcc.c b/drivers/tty/vcc.c
index 5e608173b091..716729129e01 100644
--- a/drivers/tty/vcc.c
+++ b/drivers/tty/vcc.c
@@ -1086,9 +1086,9 @@ static int vcc_tty_init(void)
pr_info("VCC: %s\n", version);
vcc_tty_driver = tty_alloc_driver(VCC_MAX_PORTS, VCC_TTY_FLAGS);
- if (!vcc_tty_driver) {
+ if (IS_ERR(vcc_tty_driver)) {
pr_err("VCC: TTY driver alloc failed\n");
- return -ENOMEM;
+ return PTR_ERR(vcc_tty_driver);
}
vcc_tty_driver->driver_name = vcc_driver_name;