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@xxxxxxx> --- 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; -- 1.9.1 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel