cnss2: Check device power state for Suspend / Resume operations

If WLAN driver probe fails, its intenal state may not be
proper. Thus check for device powered on state before calling
WLAN driver operations for suspend / resume.

Change-Id: I81da8969e9b0e0525256db8da2c0db25a996b241
Signed-off-by: Manikandan Mohan <manikand@codeaurora.org>
This commit is contained in:
Manikandan Mohan 2020-08-05 15:05:00 -07:00
commit 85799b3a85

View file

@ -2659,6 +2659,9 @@ static int cnss_pci_suspend_noirq(struct device *dev)
if (!pci_priv)
goto out;
if (!cnss_is_device_powered_on(pci_priv->plat_priv))
goto out;
driver_ops = pci_priv->driver_ops;
if (driver_ops && driver_ops->suspend_noirq)
ret = driver_ops->suspend_noirq(pci_dev);
@ -2677,6 +2680,9 @@ static int cnss_pci_resume_noirq(struct device *dev)
if (!pci_priv)
goto out;
if (!cnss_is_device_powered_on(pci_priv->plat_priv))
goto out;
driver_ops = pci_priv->driver_ops;
if (driver_ops && driver_ops->resume_noirq &&
!pci_priv->pci_link_down_ind)