From patchwork Thu Aug 28 08:38:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 36163 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f71.google.com (mail-pa0-f71.google.com [209.85.220.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E6E62202DD for ; Thu, 28 Aug 2014 08:39:23 +0000 (UTC) Received: by mail-pa0-f71.google.com with SMTP id et14sf15370924pad.10 for ; Thu, 28 Aug 2014 01:39:23 -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=gF2fL80BWUUKSOK2pLFCYSMThrN/LzIMBRHPRuD5mDE=; b=GAAwn8qKv64HugOwDr8vsyrLjIi2PjL9J4avwFAi2Cv/ZTc6yuroO/NF5C/1HT0QOI +9FEMiIxmHE7B6ZxnHLthDPfOI4LsC6ASPffFSj8i3KcHBRkCMYqgaf2/bfmBGdvdq6b RzHP/EXqiyXT3+e6l3GuQyLU4sAdWYC9D/7HpQK1Xy89yAN58T8KvghLJRs9SEb1E4tR wBRMqIPRKke//FmFDdMMrBMjee5grexoDcqgaCFanD527QJhenOR9JBhALIf7WdCVLDz q48OxZo5DNwGZpvmxqfOfzjxsnRZfNlBO3WQLo4r7288/ETKLTo7FXYTJ96zXQVwAX1s IgGg== X-Gm-Message-State: ALoCoQnzeVrjpY4Qj0L4UcMG3igwee6IJfO5pXJj4feI9AKnGE7oWvCNHj55Y0AIzScOXSV7X/6P X-Received: by 10.70.41.230 with SMTP id i6mr1497141pdl.2.1409215161912; Thu, 28 Aug 2014 01:39:21 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.46.100 with SMTP id j91ls426732qga.44.gmail; Thu, 28 Aug 2014 01:39:21 -0700 (PDT) X-Received: by 10.52.3.40 with SMTP id 8mr1696194vdz.24.1409215161784; Thu, 28 Aug 2014 01:39:21 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id ct1si2913173vdc.80.2014.08.28.01.39.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Aug 2014 01:39:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.181 as permitted sender) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id ij19so441728vcb.40 for ; Thu, 28 Aug 2014 01:39:21 -0700 (PDT) X-Received: by 10.220.116.196 with SMTP id n4mr2057790vcq.6.1409215161685; Thu, 28 Aug 2014 01:39:21 -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 uj3csp201157vcb; Thu, 28 Aug 2014 01:39:21 -0700 (PDT) X-Received: by 10.112.53.230 with SMTP id e6mr2480713lbp.100.1409215160441; Thu, 28 Aug 2014 01:39:20 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com [209.85.217.173]) by mx.google.com with ESMTPS id c10si4216013lab.76.2014.08.28.01.39.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Aug 2014 01:39:20 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by mail-lb0-f173.google.com with SMTP id c11so498631lbj.32 for ; Thu, 28 Aug 2014 01:39:19 -0700 (PDT) X-Received: by 10.152.27.134 with SMTP id t6mr2671189lag.56.1409215159882; Thu, 28 Aug 2014 01:39:19 -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 t12sm4826676lbp.44.2014.08.28.01.39.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Aug 2014 01:39:19 -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 v2 4/9] drivercore / platform: Convert to dev_pm_domain_attach|detach() Date: Thu, 28 Aug 2014 10:38:57 +0200 Message-Id: <1409215142-8218-5-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1409215142-8218-1-git-send-email-ulf.hansson@linaro.org> References: <1409215142-8218-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.181 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 power domain was supported by the platform bus. Let's convert to the common attach/detach functions for power domains, which currently means we are extending the support to include the generic power domain as well. Signed-off-by: Ulf Hansson Tested-by: Philipp Zabel --- 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); } /**