From patchwork Tue Sep 9 11:36:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 37098 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f69.google.com (mail-pa0-f69.google.com [209.85.220.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DC6D720491 for ; Tue, 9 Sep 2014 11:36:54 +0000 (UTC) Received: by mail-pa0-f69.google.com with SMTP id kx10sf14613044pab.8 for ; Tue, 09 Sep 2014 04:36:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=NTDxgrlHvXsQftO2ErKBSI7Stq4u/dCc7fe+xRC5iO8=; b=WR+cH56fyglmniMkPCk4IjiU5Jvg0QXySlCZG0ZOg/KT8IRLmoi7M3ZjUxghDnsW16 y3yzeRuBLFE45hklmLNxdBqj2y3xkk6kU4rp4clrrKPsXjA6OuGCy5JrkZ0k+LVmqBKD Zf+JL3YGs1HYUahVZmax/AHDUTUnHRcFoXyMFfF8TpR+e/DPc7Sx61OCvn6utHwdAlsY 5h8Ebhf98q2Q0rVTzbS5aJDkbn+IIyTTdFuc2P1/0b7g25xoW6jE8y7zw1vghiPEFwaC Ctl9QMsRiS7CUcKFJcIGMCrR2s537BnGpq3c2lMN+pnv6mPng0DEEIMYjHb2sLIUxjb9 O0uA== X-Gm-Message-State: ALoCoQny7oYT7BaWLOi9siSM9ePz20lDgf1/KJ8v1BTFVcoRcfKowq1xKJloybAIWSFVKnflTra+ X-Received: by 10.66.155.194 with SMTP id vy2mr21228057pab.19.1410262614241; Tue, 09 Sep 2014 04:36:54 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.51.206 with SMTP id u72ls951234qga.21.gmail; Tue, 09 Sep 2014 04:36:54 -0700 (PDT) X-Received: by 10.52.98.130 with SMTP id ei2mr84486vdb.87.1410262614132; Tue, 09 Sep 2014 04:36:54 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id w12si5065314vci.4.2014.09.09.04.36.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 09 Sep 2014 04:36:54 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.169 as permitted sender) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id ik5so298735vcb.0 for ; Tue, 09 Sep 2014 04:36:54 -0700 (PDT) X-Received: by 10.221.29.5 with SMTP id rw5mr1614214vcb.49.1410262614077; Tue, 09 Sep 2014 04:36:54 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp270185vcb; Tue, 9 Sep 2014 04:36:53 -0700 (PDT) X-Received: by 10.112.173.136 with SMTP id bk8mr2503244lbc.88.1410262610796; Tue, 09 Sep 2014 04:36:50 -0700 (PDT) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com [209.85.217.169]) by mx.google.com with ESMTPS id jt8si17560655lbc.28.2014.09.09.04.36.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 09 Sep 2014 04:36:50 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by mail-lb0-f169.google.com with SMTP id p9so7810348lbv.28 for ; Tue, 09 Sep 2014 04:36:50 -0700 (PDT) X-Received: by 10.112.149.36 with SMTP id tx4mr8931735lbb.79.1410262610302; Tue, 09 Sep 2014 04:36:50 -0700 (PDT) Received: from uffe-Latitude-E6430s.lan (90-231-160-185-no158.tbcn.telia.com. [90.231.160.185]) by mx.google.com with ESMTPSA id gn7sm4476961lbc.10.2014.09.09.04.36.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Sep 2014 04:36:49 -0700 (PDT) From: Ulf Hansson To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , Greg Kroah-Hartman , linux-pm@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, Geert Uytterhoeven , Kevin Hilman , Alan Stern , Daniel Lezcano , Tomasz Figa , devicetree@vger.kernel.org, Linus Walleij , Simon Horman , Magnus Damm , Ben Dooks , Kukjin Kim , Stephen Boyd , Philipp Zabel , Mark Brown , Wolfram Sang , Chris Ball , Russell King , Ulf Hansson Subject: [PATCH v4 4/9] drivercore / platform: Convert to dev_pm_domain_attach|detach() Date: Tue, 9 Sep 2014 13:36:05 +0200 Message-Id: <1410262570-22785-5-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1410262570-22785-1-git-send-email-ulf.hansson@linaro.org> References: <1409838756-31963-1-git-send-email-ulf.hansson@linaro.org> <1410262570-22785-1-git-send-email-ulf.hansson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.169 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Previously only the ACPI PM domain was supported by the platform bus. Let's convert to the common attach/detach functions for PM domains, which currently means we are extending the support to include the generic PM domain as well. Signed-off-by: Ulf Hansson Tested-by: Philipp Zabel Reviewed-by: Kevin Hilman --- drivers/base/platform.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/base/platform.c b/drivers/base/platform.c index ab4f4ce..904be3d 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -506,11 +506,12 @@ static int platform_drv_probe(struct device *_dev) if (ret < 0) return ret; - acpi_dev_pm_attach(_dev, true); - - ret = drv->probe(dev); - if (ret) - acpi_dev_pm_detach(_dev, true); + ret = dev_pm_domain_attach(_dev, true); + if (ret != -EPROBE_DEFER) { + ret = drv->probe(dev); + if (ret) + dev_pm_domain_detach(_dev, true); + } if (drv->prevent_deferred_probe && ret == -EPROBE_DEFER) { dev_warn(_dev, "probe deferral not supported\n"); @@ -532,7 +533,7 @@ static int platform_drv_remove(struct device *_dev) int ret; ret = drv->remove(dev); - acpi_dev_pm_detach(_dev, true); + dev_pm_domain_detach(_dev, true); return ret; } @@ -543,7 +544,7 @@ static void platform_drv_shutdown(struct device *_dev) struct platform_device *dev = to_platform_device(_dev); drv->shutdown(dev); - acpi_dev_pm_detach(_dev, true); + dev_pm_domain_detach(_dev, true); } /**