diff options
author | Quentin Deslandes <quentin.deslandes@itdev.co.uk> | 2019-05-20 16:39:02 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-05-21 08:25:03 +0200 |
commit | 7156f7d9c38799ebb5d9d92e90207ff227ec4ade (patch) | |
tree | 555193f62ba092e31eb19034279b2f369ad8c3ad /drivers/staging/vt6656/card.c | |
parent | 59608cb1de185613b3a7b1615a9b08480f5a566a (diff) |
staging: vt6656: avoid discarding called function's return code
Change some of the driver's functions in order to handle error codes
instead of discarding them. These function now returns 0 on success and
a negative errno value on error.
Signed-off-by: Quentin Deslandes <quentin.deslandes@itdev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vt6656/card.c')
-rw-r--r-- | drivers/staging/vt6656/card.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c index 501f482b41c4..08fc03d8740e 100644 --- a/drivers/staging/vt6656/card.c +++ b/drivers/staging/vt6656/card.c @@ -674,7 +674,7 @@ void vnt_update_next_tbtt(struct vnt_private *priv, u64 tsf, */ int vnt_radio_power_off(struct vnt_private *priv) { - int ret = true; + int ret = 0; switch (priv->rf_type) { case RF_AL2230: @@ -683,17 +683,25 @@ int vnt_radio_power_off(struct vnt_private *priv) case RF_VT3226: case RF_VT3226D0: case RF_VT3342A0: - vnt_mac_reg_bits_off(priv, MAC_REG_SOFTPWRCTL, - (SOFTPWRCTL_SWPE2 | SOFTPWRCTL_SWPE3)); + ret = vnt_mac_reg_bits_off(priv, MAC_REG_SOFTPWRCTL, + (SOFTPWRCTL_SWPE2 | SOFTPWRCTL_SWPE3)); break; } - vnt_mac_reg_bits_off(priv, MAC_REG_HOSTCR, HOSTCR_RXON); + if (ret) + goto end; + + ret = vnt_mac_reg_bits_off(priv, MAC_REG_HOSTCR, HOSTCR_RXON); + if (ret) + goto end; - vnt_set_deep_sleep(priv); + ret = vnt_set_deep_sleep(priv); + if (ret) + goto end; - vnt_mac_reg_bits_on(priv, MAC_REG_GPIOCTL1, GPIO3_INTMD); + ret = vnt_mac_reg_bits_on(priv, MAC_REG_GPIOCTL1, GPIO3_INTMD); +end: return ret; } |