From patchwork Tue Aug 26 12:07:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 36002 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f199.google.com (mail-pd0-f199.google.com [209.85.192.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 18B422054F for ; Tue, 26 Aug 2014 12:07:57 +0000 (UTC) Received: by mail-pd0-f199.google.com with SMTP id v10sf117535687pde.10 for ; Tue, 26 Aug 2014 05:07:56 -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=vuq2z7kJhwaGJPn9qUYyb2nHkt+TUWo8MO/tCj5dKIw=; b=T0crfbXtmb5f8Kwk5xKJn2ijOQ5atw6ggqc37W6aieZsa1vpxjydKRc0WWoifR3Dlf OsPZjbhu02PrCHubfuC36ePsp3KakTJSUXliXbHVD1XGlTHl8qbUy4jpq/0GkGsJJhee 7Yp+p/RQwS1zZMSK30iMHjTWIwiJpzKiIxqusPBZQpFqJpM1tJ1rTT3gIQnu05DXZJhM WEmnvw2vHDj36RDd6siQ1U7SJm3o28ZwpZtL82H2dWTXZLeRzXYf0mPL96ES1hRQlIzJ 4ojTwsx9jBIHH2+b5iIq+QVLdpwMZ62vMeF6TvKYnGoWSH8VtKMm5Ak5Kc/dp6E3mA6i j/6g== X-Gm-Message-State: ALoCoQkp/bwmME9yhA08zOMh4erD84KxjibAfBJ+e6KxZZuIilJCnRsCc3vaIItQrgUtgqhr93m9 X-Received: by 10.66.65.131 with SMTP id x3mr16444247pas.13.1409054876104; Tue, 26 Aug 2014 05:07:56 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.37.35 with SMTP id q32ls973187qgq.50.gmail; Tue, 26 Aug 2014 05:07:56 -0700 (PDT) X-Received: by 10.52.168.134 with SMTP id zw6mr720898vdb.37.1409054875969; Tue, 26 Aug 2014 05:07:55 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id 10si1273707vci.55.2014.08.26.05.07.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 26 Aug 2014 05:07:55 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id hq11so16830744vcb.10 for ; Tue, 26 Aug 2014 05:07:55 -0700 (PDT) X-Received: by 10.52.27.16 with SMTP id p16mr1785394vdg.14.1409054875887; Tue, 26 Aug 2014 05:07:55 -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 uj3csp193028vcb; Tue, 26 Aug 2014 05:07:55 -0700 (PDT) X-Received: by 10.112.8.99 with SMTP id q3mr13568788lba.85.1409054874519; Tue, 26 Aug 2014 05:07:54 -0700 (PDT) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com [209.85.217.177]) by mx.google.com with ESMTPS id ap7si3310743lac.63.2014.08.26.05.07.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 26 Aug 2014 05:07:54 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id l4so1202620lbv.8 for ; Tue, 26 Aug 2014 05:07:54 -0700 (PDT) X-Received: by 10.152.28.134 with SMTP id b6mr27367366lah.33.1409054873959; Tue, 26 Aug 2014 05:07:53 -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 ai1sm4908979lbd.12.2014.08.26.05.07.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Aug 2014 05:07:53 -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 4/9] drivercore / platform: Convert to dev_pm_domain_attach|detach() Date: Tue, 26 Aug 2014 14:07:12 +0200 Message-Id: <1409054837-5667-5-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1409054837-5667-1-git-send-email-ulf.hansson@linaro.org> References: <1409054837-5667-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.179 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 --- 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); } /**