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>
This commit is contained in:
Salah Triki 2015-03-05 03:50:24 +01:00 committed by Greg Kroah-Hartman
parent 834d86735d
commit 5f9dca1e7d
1 changed files with 2 additions and 2 deletions

View File

@ -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;