diff mbox

[v2] Correctly fail to suspend when SDIO does not support power on suspend

Message ID F895C8CD-1D0E-46CB-9C12-5B4775E76217@lairdtech.com (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show

Commit Message

Eric Bentley Sept. 1, 2017, 12:04 a.m. UTC
Return error when failing to set power management capabilities flag.  This will cause the suspend to fail but the radio
will continue to operate.  Allowing this to fail without reporting error will cause the radio to be non-functional on 
resume as it will have lost power.

Signed-off-by: Eric Bentley eric.bentley@lairdtech.com

---
v2: corrected errant ( with {
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

-- 
2.6.0.GIT

Comments

Kalle Valo Sept. 1, 2017, 5:30 a.m. UTC | #1
Eric Bentley <Eric.Bentley@lairdtech.com> writes:

> Return error when failing to set power management capabilities flag.  This will cause the suspend to fail but the radio
> will continue to operate.  Allowing this to fail without reporting error will cause the radio to be non-functional on 
> resume as it will have lost power.
>
> Signed-off-by: Eric Bentley eric.bentley@lairdtech.com

Word wrap the commit log to 72 chars (or so) per line. Also add a prefix
to the title:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#commit_title_is_wrong
diff mbox

Patch

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
index 72139b5..2f7d03f 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
@@ -1264,8 +1264,10 @@  static int brcmf_ops_sdio_suspend(struct device *dev)
                 else
                         sdio_flags |= MMC_PM_WAKE_SDIO_IRQ;
         }
-       if (sdio_set_host_pm_flags(sdiodev->func[1], sdio_flags))
+       if (sdio_set_host_pm_flags(sdiodev->func[1], sdio_flags)) {
                 brcmf_err("Failed to set pm_flags %x\n", sdio_flags);
+               return -EINVAL;
+       }
         return 0;
 }