Skip to contentSkip to conversation

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

PATCH New [email protected] 1 participant 1 message May 8, 2017 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

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

From: Dan Carpenter <[email protected]>
Subject: drivers/misc/c2port/c2port-duramar2150.c: checking for NULL instead of IS_ERR()

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

Fixes 65131cd52b9e ("c2port: add c2port support for Eurotech Duramar 2150")
Cc Greg Kroah-Hartman <[email protected]>

---

 drivers/misc/c2port/c2port-duramar2150.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/misc/c2port/c2port-duramar2150.c renamed from drivers/misc/c2port/c2port-duramar2150.c~c2port-checking-for-null-instead-of-is_err +2 -2
diff -puN drivers/misc/c2port/c2port-duramar2150.c~c2port-checking-for-null-instead-of-is_err drivers/misc/c2port/c2port-duramar2150.c
@@ -129,8 +129,8 @@ static int __init duramar2150_c2port_ini
 
 	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;
 	}
 

_