diff options
author | Jérôme Pouiller <jerome.pouiller@silabs.com> | 2020-10-09 19:13:05 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-10-10 12:33:59 +0200 |
commit | 8522d62e6bca8c8b2fbf456523f01bf36468239c (patch) | |
tree | 751f5d5549ba479f9963cdfebab539a83174609a /drivers/staging/wfx/bh.c | |
parent | staging: wfx: increase robustness of hif_generic_confirm() (diff) | |
download | wireguard-linux-8522d62e6bca8c8b2fbf456523f01bf36468239c.tar.xz wireguard-linux-8522d62e6bca8c8b2fbf456523f01bf36468239c.zip |
staging: wfx: gpiod_get_value() can return an error
Smatch complains:
hif_rx.c:98 hif_wakeup_indication() warn: 'gpiod_get_value(wdev->pdata.gpio_wakeup)' returns positive and negative
bh.c:24 device_wakeup() warn: 'gpiod_get_value_cansleep(wdev->pdata.gpio_wakeup)' returns positive and negative
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20201009171307.864608-7-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wfx/bh.c')
-rw-r--r-- | drivers/staging/wfx/bh.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c index 586b769c0446..2ffa587aefaa 100644 --- a/drivers/staging/wfx/bh.c +++ b/drivers/staging/wfx/bh.c @@ -21,7 +21,7 @@ static void device_wakeup(struct wfx_dev *wdev) if (!wdev->pdata.gpio_wakeup) return; - if (gpiod_get_value_cansleep(wdev->pdata.gpio_wakeup)) + if (gpiod_get_value_cansleep(wdev->pdata.gpio_wakeup) >= 0) return; if (wfx_api_older_than(wdev, 1, 4)) { |