Commit 235efbf2 authored by Dan Carpenter's avatar Dan Carpenter Committed by Sasha Levin

drivers/misc/c2port/c2port-duramar2150.c: checking for NULL instead of IS_ERR()

[ Upstream commit 8128a31e ]

c2port_device_register() never returns NULL, it uses error pointers.

Link: http://lkml.kernel.org/r/20170412083321.GC3250@mwanda
Fixes: 65131cd5 ("c2port: add c2port support for Eurotech Duramar 2150")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarRodolfo Giometti <giometti@linux.it>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
parent d5db0876
......@@ -129,8 +129,8 @@ static int __init duramar2150_c2port_init(void)
duramar2150_c2port_dev = c2port_device_register("uc",
&duramar2150_c2port_ops, NULL);
if (!duramar2150_c2port_dev) {
ret = -ENODEV;
if (IS_ERR(duramar2150_c2port_dev)) {
ret = PTR_ERR(duramar2150_c2port_dev);
goto free_region;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment