Commit 5f9dca1e authored by Salah Triki's avatar Salah Triki Committed by Greg Kroah-Hartman

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: default avatarSalah Triki <salah.triki@acm.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 834d8673
...@@ -251,9 +251,9 @@ static int dgnc_start(void) ...@@ -251,9 +251,9 @@ static int dgnc_start(void)
* Register management/dpa devices * Register management/dpa devices
*/ */
rc = register_chrdev(0, "dgnc", &dgnc_BoardFops); 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); pr_err(DRVSTR ": Can't register dgnc driver device (%d)\n", rc);
return -ENXIO; return rc;
} }
dgnc_Major = rc; dgnc_Major = rc;
......
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