From 5f9dca1e7d5a5463f9e9cc4e1f5c8e9bc9d118a9 Mon Sep 17 00:00:00 2001 From: Salah Triki Date: Thu, 5 Mar 2015 03:50:24 +0100 Subject: [PATCH] Staging: dgnc: Fix checking return value of register_chrdev The failure code is negative. So check <0 instead of <=0. Return the failure code instead of -ENXIO. Signed-off-by: Salah Triki Signed-off-by: Greg Kroah-Hartman --- drivers/staging/dgnc/dgnc_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index c1d1a97..fa1ee79 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -251,9 +251,9 @@ static int dgnc_start(void) * Register management/dpa devices */ rc = register_chrdev(0, "dgnc", &dgnc_BoardFops); - if (rc <= 0) { + if (rc < 0) { pr_err(DRVSTR ": Can't register dgnc driver device (%d)\n", rc); - return -ENXIO; + return rc; } dgnc_Major = rc; -- 2.7.4