From patchwork Wed Jun 21 19:21:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 106119 Delivered-To: patches@linaro.org Received: by 10.140.91.2 with SMTP id y2csp2092644qgd; Wed, 21 Jun 2017 12:21:54 -0700 (PDT) X-Received: by 10.25.158.78 with SMTP id h75mr11186915lfe.178.1498072914079; Wed, 21 Jun 2017 12:21:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498072914; cv=none; d=google.com; s=arc-20160816; b=gZwDc8aNQVv2ANCB5ly4ewV9QdfzzxKT/vl09OQig6bSCBMWrq8zXw7pisimYS580Y M2ETy7zmdHCt0/ncKgFBmKLWyWy21+Le6H+s8/qaHk5N2HTJh77BlzaI2Dqooq88qTnH CGB8s1faf1UF5WlrvmDCogQX5dtFwgC0EWzy3ncTXpQICr/thBbqrnWkx9ZRGD7rxKRN obSYdHkutkGSzQQKOSv0cI+TeRQ0n//IgTUuAItsRzJ6AzecDFjKbmGZ+2VZuJb+c6AD u4ZuuDpprLuNRrx13sVYolaASV/e0OA+1wadnO0YT/MN6nAnTdChZvCYUwkFpj4wSnDj xFQw== 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=JaEwCekFsuVLnVwL8IUqLgCL1SsSfKEdsOUQ9nlXA3M=; b=efbY06ql35+2qtoAsW1NSeKWyGuEoCuJx2e7gPHXcZV7FCK+Nq2AWyy6sgf0qvMlIV R/LhZNN2kz1yVmOmUS+anJGjxJbTgIN2fIcCqJeBxEWr6rzd26vQdx47vnZNBLDq3Thd bqAq5r8rxTltXMDOeU/ocKz0f0Um8FhDdvFYdqXlbT5GSvC9ORcivY9hK05FIoJMIJ8h FxQDmLEpvijRq4mDfBis3zyBV0kEpDudoDbrwqL4iq7novBuHfbbhl36ENRhxObLj8kE tiW/CnnfOnbN253q1SqPZKxnF7jt1RClhD0OhHKJtbkDdfNOX0ZSIo8GY8FO9eu2C13U B9Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=PMLMk2+V; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::229 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-x229.google.com (mail-lf0-x229.google.com. [2a00:1450:4010:c07::229]) by mx.google.com with ESMTPS id d23si9668424lfb.242.2017.06.21.12.21.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Jun 2017 12:21:54 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::229 as permitted sender) client-ip=2a00:1450:4010:c07::229; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.b=PMLMk2+V; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::229 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-x229.google.com with SMTP id p189so102984795lfe.2 for ; Wed, 21 Jun 2017 12:21:53 -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=JaEwCekFsuVLnVwL8IUqLgCL1SsSfKEdsOUQ9nlXA3M=; b=PMLMk2+VMub8w9US46yrAeuN3GiD9ZZINXAT4O6g/cAoUyApaT3WqTH7bmSEstBpvx 9znN2wtGdSEjq54DHcr15CguRdWyroKQIgFin21ddvZQPtsbWlY6EYP7Pa1hf89sd1+H OI7KstOCGFqv05+O+Mx+o7zk6lu4uyaLRlfEw= 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=JaEwCekFsuVLnVwL8IUqLgCL1SsSfKEdsOUQ9nlXA3M=; b=AB/m42qHJnCfx3IHmwubXFWwpNU1Yh8dbQLCX6re7NANr83Cr3JtRKCGAzpPX2ufyz 0eC6bCnCezSocsxF/OE0Jqj6Mpf/SklaNHrZ8t8phXlaXx79Urpx6kwTJvLZWUQgr6mZ WMJmPgnjUxmvGgdwdhtjX94FTP7qap/ikSFnv7gqHrTWvm+X9xhyLDxMvlac4ThfcAqI rt/51HZ87+Td5QcjxV17U+goVQOEUVUSGkTi2OqnkMWi3UmZjZX5JfWBGsE9JHak5znq 299OuKhcNp+cIBJTL4hB1NgwshX99ws5YTKUNAyNdNo5/sYBlb7pOaGVz2dB5bOzcyGJ saCA== X-Gm-Message-State: AKS2vOyfkBIV6isR5ZokycijASJC9ZqiIIIpreKLeS1qR7xRQWHZuLV9 Rm+8qM4vWW8QNF5fj9s= X-Received: by 10.46.84.90 with SMTP id y26mr11084220ljd.77.1498072913735; Wed, 21 Jun 2017 12:21:53 -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 t24sm3920047ljd.1.2017.06.21.12.21.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 Jun 2017 12:21:53 -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 5/9] PM / ACPI: Split acpi_lpss_suspend_late|resume_early() Date: Wed, 21 Jun 2017 21:21:24 +0200 Message-Id: <1498072888-14782-6-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498072888-14782-1-git-send-email-ulf.hansson@linaro.org> References: <1498072888-14782-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 --- 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 d7b6778..12bc5c7 100644 --- a/drivers/acpi/acpi_lpss.c +++ b/drivers/acpi/acpi_lpss.c @@ -702,22 +702,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; @@ -731,6 +737,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 */