HSI: hsi-char: fix driver for multiport scenarios
authorSebastian Reichel <sre@kernel.org>
Fri, 20 Sep 2013 20:42:22 +0000 (22:42 +0200)
committerSebastian Reichel <sre@kernel.org>
Sun, 4 May 2014 07:49:58 +0000 (09:49 +0200)
Fix return code check of alloc_chrdev_region, which
returns 0 on success.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Reviewed-by: Pavel Machek <pavel@ucw.cz>
drivers/hsi/clients/hsi_char.c

index e61e5f991aa538831644c5c1d1f13e5f71a69334..30733209fde2c5c47614c66887c4876b93750bb4 100644 (file)
@@ -705,7 +705,7 @@ static int hsc_probe(struct device *dev)
        if (!hsc_major) {
                ret = alloc_chrdev_region(&hsc_dev, hsc_baseminor,
                                                HSC_DEVS, devname);
-               if (ret > 0)
+               if (ret == 0)
                        hsc_major = MAJOR(hsc_dev);
        } else {
                hsc_dev = MKDEV(hsc_major, hsc_baseminor);