mirror of https://gitee.com/openkylin/linux.git
HSI: hsi-char: fix driver for multiport scenarios
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>
This commit is contained in:
parent
56459ea9aa
commit
84d93b5e60
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue