Staging: dgnc: Fix checking return value of register_chrdev
authorSalah Triki <salah.triki@acm.org>
Thu, 5 Mar 2015 02:50:24 +0000 (03:50 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Mar 2015 00:12:22 +0000 (16:12 -0800)
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>
drivers/staging/dgnc/dgnc_driver.c

index c1d1a97e0c94601420249dad3fd4a5d6e9a9b7e8..fa1ee79ef88e5ab070335e1ce1b2eeaaf4697bd9 100644 (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;