Browse Source

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 <salah.triki@acm.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Salah Triki 10 years ago
parent
commit
5f9dca1e7d
1 changed files with 2 additions and 2 deletions
  1. 2 2
      drivers/staging/dgnc/dgnc_driver.c

+ 2 - 2
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;