From patchwork Fri Sep 19 18:27:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 37650 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5370620293 for ; Fri, 19 Sep 2014 18:28:14 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id l4sf1874562lbv.0 for ; Fri, 19 Sep 2014 11:28:13 -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=BwwWj8e2kZ+fzYSM4Kds302sjEN88+NZlYQj4QlpEB6ze6ODK3GWwJyE/0pHy8aQs7 UVJ6tJA+tvNr8ftpW8RnH/Z237JIBBd4nOzsfVcq/2Hz323Qgs8KSnobG92xd7Lz8pjk FBrg2Yt+QgLDpp9Ys6tmSC0DQf3wz2z09MLz7wdl0H/jL9jqiAeZ+kSJYf9shZ1EPewb XtntAs6TiKfWftNjHLoPkFbFOcoGHcpn656zkQivlRGpxkmL1qfSo4ivp5oq9KKM9aDB 732co29PbbVEmISPodzT0ONiUYAaUHvC7+Us9Z4O/uYqVESTBvj3PrmqvgttQIGchLzL bFDg== X-Gm-Message-State: ALoCoQn2XuO/VTWo+po6r5v920bhjZOXCuWYc1dhs5S23v/Js3WL9f3wnQOTHSNPdKvOMCn786/2 X-Received: by 10.112.170.166 with SMTP id an6mr242853lbc.17.1411151293050; Fri, 19 Sep 2014 11:28:13 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.6.2 with SMTP id cq2ls345888lad.102.gmail; Fri, 19 Sep 2014 11:28:12 -0700 (PDT) X-Received: by 10.152.21.42 with SMTP id s10mr8552491lae.61.1411151292807; Fri, 19 Sep 2014 11:28:12 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com [209.85.217.171]) by mx.google.com with ESMTPS id qo6si3549760lbb.138.2014.09.19.11.28.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 19 Sep 2014 11:28:12 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by mail-lb0-f171.google.com with SMTP id l4so3701107lbv.16 for ; Fri, 19 Sep 2014 11:28:12 -0700 (PDT) X-Received: by 10.152.42.136 with SMTP id o8mr8420875lal.71.1411151292491; Fri, 19 Sep 2014 11:28:12 -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.112.130.169 with SMTP id of9csp989512lbb; Fri, 19 Sep 2014 11:28:11 -0700 (PDT) X-Received: by 10.66.253.106 with SMTP id zz10mr3993894pac.67.1411151286594; Fri, 19 Sep 2014 11:28:06 -0700 (PDT) Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by mx.google.com with ESMTPS id m2si4292657pdb.58.2014.09.19.11.28.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 19 Sep 2014 11:28:06 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.192.182 as permitted sender) client-ip=209.85.192.182; Received: by mail-pd0-f182.google.com with SMTP id p10so255522pdj.27 for ; Fri, 19 Sep 2014 11:28:05 -0700 (PDT) X-Received: by 10.68.225.133 with SMTP id rk5mr2695183pbc.101.1411151285915; Fri, 19 Sep 2014 11:28:05 -0700 (PDT) Received: from localhost.localdomain ([38.126.120.10]) by mx.google.com with ESMTPSA id ki1sm2495071pdb.59.2014.09.19.11.28.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 19 Sep 2014 11:28:04 -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 , Dmitry Torokhov , Ulf Hansson Subject: [PATCH v5 05/11] drivercore / platform: Convert to dev_pm_domain_attach|detach() Date: Fri, 19 Sep 2014 20:27:38 +0200 Message-Id: <1411151264-16245-6-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1411151264-16245-1-git-send-email-ulf.hansson@linaro.org> References: <1411151264-16245-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.217.171 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); } /**