提交 525e1abc 编写于 作者: A Andrzej Hajda 提交者: Sebastian Reichel

HSI: omap_ssi_port: fix handling of_get_named_gpio result

The function can return negative value.

The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1].

[1]: http://permalink.gmane.org/gmane.linux.kernel/2038576Signed-off-by: NAndrzej Hajda <a.hajda@samsung.com>
Signed-off-by: NSebastian Reichel <sre@kernel.org>
上级 6bf6ded3
无相关合并请求
......@@ -1147,13 +1147,13 @@ static int __init ssi_port_probe(struct platform_device *pd)
goto error;
}
cawake_gpio = of_get_named_gpio(np, "ti,ssi-cawake-gpio", 0);
if (cawake_gpio < 0) {
err = of_get_named_gpio(np, "ti,ssi-cawake-gpio", 0);
if (err < 0) {
dev_err(&pd->dev, "DT data is missing cawake gpio (err=%d)\n",
cawake_gpio);
err = -ENODEV;
err);
goto error;
}
cawake_gpio = err;
err = devm_gpio_request_one(&port->device, cawake_gpio, GPIOF_DIR_IN,
"cawake");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册