提交 5f9dca1e 编写于 作者: S Salah Triki 提交者: Greg Kroah-Hartman

Staging: dgnc: Fix checking return value of register_chrdev

The failure code is negative. So check <0 instead of <=0.
Return the failure code instead of -ENXIO.
Signed-off-by: NSalah Triki <salah.triki@acm.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 834d8673
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册