From patchwork Wed Aug 23 14:42:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 110850 Delivered-To: patches@linaro.org Received: by 10.37.128.210 with SMTP id c18csp7031435ybm; Wed, 23 Aug 2017 07:42:22 -0700 (PDT) X-Received: by 10.25.198.19 with SMTP id w19mr914567lff.211.1503499342509; Wed, 23 Aug 2017 07:42:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503499342; cv=none; d=google.com; s=arc-20160816; b=TAOdTVBRhkKBBGwX7Natw3uUPNrvDVEms+OUVFIGohMCfMTrn25I9J2K7ZNhw/k6cd jY+GiUuWfOAb70kZvNU9EP01aKTcA+9i1i76YfrtZ/aPmec1khk4SaVHvCTfVlPio3wq eV0RhTY+lGlzyR8YUX5wsGlRR+gmmO+1cpjf54LSY61uxdA5EazSNScf6K9rJPTGsp2U n6SZ8AlCdHfgxLnpVl5ir90JGH4ibnYWdgPAHUz4XU9tITy5QiRjd/GmLwfVVf0JpyC1 wddsM+Ep6JFiZBD8Ba3wruBaui+FGTeIzdbFwPHg0BRzRZV+x7BdWkwdGxOUFLAihfr+ kixQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=VxCQHodaKHhG0+hTeLvSHBW3NEuDXnKN4by+eq4cwcM=; b=hUYAUNKJG0snYdGSJctrEoRTHHbkCXLKXBjXxWt6PrVPgOvEZ+TGxXki9e5k4WYkM5 OLW4Tomuoo7SqcSyr3UTaDlfPFJdeCRDnqb8R27nikQMKu8rUfuJHsWKm8OWef6/Atg1 mStnFxq4qkeQLG43Dgn7N+gERPBJHlGzE3y7t4DGFc2h/qRtxIZwbPn1vMKE9VHbYiq+ 33BnfeGndabvkhxLN/ZcocmhANY8Ky1qKD456KefkHZFz+2xnjsg0877VOgcIG01uzIo /8jbWRfigZNgJ0UwujV62kLQOJU4FVuL9QpRXzfxPFJJLGEsqsXC6sBS1iOOZakbqBse bz+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dcmFdWaJ; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::230 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-lf0-x230.google.com (mail-lf0-x230.google.com. [2a00:1450:4010:c07::230]) by mx.google.com with ESMTPS id n75si799209lja.41.2017.08.23.07.42.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Aug 2017 07:42:22 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::230 as permitted sender) client-ip=2a00:1450:4010:c07::230; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dcmFdWaJ; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::230 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by mail-lf0-x230.google.com with SMTP id d17so1564929lfe.0 for ; Wed, 23 Aug 2017 07:42:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VxCQHodaKHhG0+hTeLvSHBW3NEuDXnKN4by+eq4cwcM=; b=dcmFdWaJvixzT7Pue/FcXmWuNsI9f6cG8QJ9/+QVxpqRf8/7KPYdTXktvrE6ZEEO3h zLdFCHVxM+LffQaVchX0tjKI+l9HDEEQIV8t+bWpTlFqMvA/5lEBNH3asHpnZmN82edW nPDyxwvdt75Hg8J+JF/38ATlHJhJ7ViAwNngo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VxCQHodaKHhG0+hTeLvSHBW3NEuDXnKN4by+eq4cwcM=; b=srp3FyjF+yR3lzt1mq849Gm+MnbTjnNSsShf1WIvDJYyuvux8vb+3ZPOUaFQEwkGog q7M4keYsef3fvBozHwuSnH8zeoJcF9V0lrupcP5kAaX1jM641D/qG4DYUmw5by46N89a DJBTmMkhMe2JCDqRtvJ1ro9SU1k3zf3K24jWbOrow7y0H9axXSO2zD4MZZq3pasuxc3x uv/q7PsuYqmiI+g8owHmQPJXgM+t5TgJwseHODoql9VAhExrLTQwjp53dNtcAlMY7G+6 KvQiWOKiT+kTFs/+A3Vbcj5PcdZU0AFzPMZxi48LyNOHZTi+svl2yXHRh3qCEtThz6jI tn8A== X-Gm-Message-State: AHYfb5ib6hMw7QEIsJ4gvEBh4jlW+Ph+Da4AqFgBEXeGf2n9ut9Ky0Ji 9plvu+UdeWL0F8pVu0M= X-Received: by 10.46.84.83 with SMTP id y19mr1129581ljd.167.1503499342117; Wed, 23 Aug 2017 07:42:22 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-158-174-22-67.NA.cust.bahnhof.se. [158.174.22.67]) by smtp.gmail.com with ESMTPSA id c89sm287593lfb.78.2017.08.23.07.42.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 23 Aug 2017 07:42:21 -0700 (PDT) From: Ulf Hansson To: Wolfram Sang , "Rafael J . Wysocki" , Len Brown , linux-acpi@vger.kernel.org, linux-pm@vger.kernel.org Cc: Kevin Hilman , Jarkko Nikula , Andy Shevchenko , Mika Westerberg , Jisheng Zhang , John Stultz , Guodong Xu , Sumit Semwal , Haojian Zhuang , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, Ulf Hansson Subject: [PATCH v2 4/9] PM / ACPI: Split acpi_lpss_suspend_late|resume_early() Date: Wed, 23 Aug 2017 16:42:04 +0200 Message-Id: <1503499329-28834-5-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503499329-28834-1-git-send-email-ulf.hansson@linaro.org> References: <1503499329-28834-1-git-send-email-ulf.hansson@linaro.org> Move the code which is special to ACPI LPSS into separate functions. This may clarify the code a bit, but the main purpose of this change, is instead to prepare for additional changes on top. Ideally the following changes should then become easier to review. Signed-off-by: Ulf Hansson --- Changes in v2: - None. --- drivers/acpi/acpi_lpss.c | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) -- 2.7.4 diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c index 0c84d15..e726173 100644 --- a/drivers/acpi/acpi_lpss.c +++ b/drivers/acpi/acpi_lpss.c @@ -717,22 +717,28 @@ static void acpi_lpss_dismiss(struct device *dev) } #ifdef CONFIG_PM_SLEEP -static int acpi_lpss_suspend_late(struct device *dev) +static int lpss_suspend_late(struct device *dev) { struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev)); + + if (pdata->dev_desc->flags & LPSS_SAVE_CTX) + acpi_lpss_save_ctx(dev, pdata); + + return acpi_dev_suspend_late(dev); +} + +static int acpi_lpss_suspend_late(struct device *dev) +{ int ret; ret = pm_generic_suspend_late(dev); if (ret) return ret; - if (pdata->dev_desc->flags & LPSS_SAVE_CTX) - acpi_lpss_save_ctx(dev, pdata); - - return acpi_dev_suspend_late(dev); + return lpss_suspend_late(dev); } -static int acpi_lpss_resume_early(struct device *dev) +static int lpss_resume_early(struct device *dev) { struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev)); int ret; @@ -746,6 +752,17 @@ static int acpi_lpss_resume_early(struct device *dev) if (pdata->dev_desc->flags & LPSS_SAVE_CTX) acpi_lpss_restore_ctx(dev, pdata); + return 0; +} + +static int acpi_lpss_resume_early(struct device *dev) +{ + int ret; + + ret = lpss_resume_early(dev); + if (ret) + return ret; + return pm_generic_resume_early(dev); } #endif /* CONFIG_PM_SLEEP */