diff options
author | Andrzej Hajda <a.hajda@samsung.com> | 2015-09-21 16:33:44 +0300 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2016-01-07 18:07:54 +0300 |
commit | 525e1abc6b5a7d8bd9006de1da6e99722305ea2b (patch) | |
tree | 79703a6b4d2c5247544f2be9ed56475f58be4bac | |
parent | 6bf6ded3008a407ccab5ad72eb59ab71b97cc290 (diff) | |
download | linux-525e1abc6b5a7d8bd9006de1da6e99722305ea2b.tar.xz |
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/2038576
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
-rw-r--r-- | drivers/hsi/controllers/omap_ssi_port.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/hsi/controllers/omap_ssi_port.c b/drivers/hsi/controllers/omap_ssi_port.c index 02e66032ae73..e80a66e20998 100644 --- a/drivers/hsi/controllers/omap_ssi_port.c +++ b/drivers/hsi/controllers/omap_ssi_port.c @@ -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"); |