提交 84d93b5e 编写于 作者: S Sebastian Reichel

HSI: hsi-char: fix driver for multiport scenarios

Fix return code check of alloc_chrdev_region, which
returns 0 on success.
Signed-off-by: NSebastian Reichel <sre@kernel.org>
Reviewed-by: NPavel Machek <pavel@ucw.cz>
上级 56459ea9
...@@ -705,7 +705,7 @@ static int hsc_probe(struct device *dev) ...@@ -705,7 +705,7 @@ static int hsc_probe(struct device *dev)
if (!hsc_major) { if (!hsc_major) {
ret = alloc_chrdev_region(&hsc_dev, hsc_baseminor, ret = alloc_chrdev_region(&hsc_dev, hsc_baseminor,
HSC_DEVS, devname); HSC_DEVS, devname);
if (ret > 0) if (ret == 0)
hsc_major = MAJOR(hsc_dev); hsc_major = MAJOR(hsc_dev);
} else { } else {
hsc_dev = MKDEV(hsc_major, hsc_baseminor); hsc_dev = MKDEV(hsc_major, hsc_baseminor);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册