Skip to content

Commit

Permalink
HSI: hsi-char: fix driver for multiport scenarios
Browse files Browse the repository at this point in the history
Fix return code check of alloc_chrdev_region, which
returns 0 on success.

Signed-off-by: Sebastian Reichel <[email protected]>
Reviewed-by: Pavel Machek <[email protected]>
  • Loading branch information
sre committed May 4, 2014
1 parent 56459ea commit 84d93b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hsi/clients/hsi_char.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 84d93b5

Please sign in to comment.