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:
parent
834d86735d
commit
5f9dca1e7d
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue