From ea637de7e471365aa7f4e0eed3816d203fa04dbd Mon Sep 17 00:00:00 2001 From: Karthikeyan Ramasubramanian Date: Tue, 16 Aug 2016 17:02:38 -0600 Subject: [PATCH] soc: qcom: glink_spi_xprt: Fix the suspend and resume sequence If the WDSP component framework does not detect the concerned subsystem, then the G-Link SPI Transport returns error. This prevents the system from suspending. If the concerned subsystem is not found, then let the system to suspend. CRs-Fixed: 1055800 Change-Id: Id17993dbf28b45308464a7e0d1e5404747fefee1 Signed-off-by: Karthikeyan Ramasubramanian --- drivers/soc/qcom/glink_spi_xprt.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/soc/qcom/glink_spi_xprt.c b/drivers/soc/qcom/glink_spi_xprt.c index 6c91ac54821d..66caa6ecaad2 100644 --- a/drivers/soc/qcom/glink_spi_xprt.c +++ b/drivers/soc/qcom/glink_spi_xprt.c @@ -210,11 +210,12 @@ static uint32_t negotiate_features_v1(struct glink_transport_if *if_ptr, */ static int wdsp_suspend(struct glink_cmpnt *cmpnt) { + int rc = 0; + if (cmpnt && cmpnt->master_dev && cmpnt->master_ops && cmpnt->master_ops->suspend) - return cmpnt->master_ops->suspend(cmpnt->master_dev); - else - return -EINVAL; + rc = cmpnt->master_ops->suspend(cmpnt->master_dev); + return rc; } /** @@ -225,11 +226,12 @@ static int wdsp_suspend(struct glink_cmpnt *cmpnt) */ static int wdsp_resume(struct glink_cmpnt *cmpnt) { + int rc = 0; + if (cmpnt && cmpnt->master_dev && cmpnt->master_ops && cmpnt->master_ops->resume) - return cmpnt->master_ops->resume(cmpnt->master_dev); - else - return -EINVAL; + rc = cmpnt->master_ops->resume(cmpnt->master_dev); + return rc; } /**