From patchwork Thu Sep 4 13:52:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 36709 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 ACB9A20CBB for ; Thu, 4 Sep 2014 13:53:01 +0000 (UTC) Received: by mail-pa0-f71.google.com with SMTP id et14sf93988636pad.2 for ; Thu, 04 Sep 2014 06:52:59 -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=i2zfZgsQ0hYXUOPmN+bZ+xLdzjEsLlRbxqV1/JPCePc=; b=X6U1BZEOFV/dmH4Uv26WVaDhP2L4LbFtYW818jPHbUNb5nPlezVb1gpnCRx+mfFJKd 80nUz0+DUsl4ylu/F7959MWf7/IAxqCurHTECu+pQpjt8Hrv0FxUhQg31ow1KIvWJz3U b1jzX/y+ccMSszZC2KF+Wj/vCLDFB6k1ayfkKT8rbHR5jaoQm+8Ky+Q4HQ/PJEhb0424 XNfaSWRoRKiCTwb7zw7R8sHJmFHkQ6T8yLuTZaWWl6c2hLu5m6jWA3QFr4YGJe7BA22u JJ/BzzwpMUcWIMvAy4dLSokB8eYTtDRSG8SoZaWvk90dROmR1yj+58htzy3+ddsOSFWJ mU2A== X-Gm-Message-State: ALoCoQkRihCHp/QcWuDXD9yjbcDwXIvS0qQ8LjeVsjihOZcXgOTIa7f9Mi1BM8SJJBCv3Tb/d0Ik X-Received: by 10.66.249.197 with SMTP id yw5mr2413842pac.34.1409838778787; Thu, 04 Sep 2014 06:52:58 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.95.50 with SMTP id h47ls202910qge.43.gmail; Thu, 04 Sep 2014 06:52:58 -0700 (PDT) X-Received: by 10.220.44.136 with SMTP id a8mr1379758vcf.42.1409838778646; Thu, 04 Sep 2014 06:52:58 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id v8si5654634vcx.74.2014.09.04.06.52.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Sep 2014 06:52:58 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.178 as permitted sender) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id la4so10820403vcb.9 for ; Thu, 04 Sep 2014 06:52:58 -0700 (PDT) X-Received: by 10.220.169.72 with SMTP id x8mr1333191vcy.45.1409838778556; Thu, 04 Sep 2014 06:52:58 -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 uj3csp841213vcb; Thu, 4 Sep 2014 06:52:57 -0700 (PDT) X-Received: by 10.112.135.137 with SMTP id ps9mr4677815lbb.24.1409838777299; Thu, 04 Sep 2014 06:52:57 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx.google.com with ESMTPS id xk12si7544548lac.35.2014.09.04.06.52.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Sep 2014 06:52:57 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by mail-la0-f54.google.com with SMTP id b17so12038783lan.27 for ; Thu, 04 Sep 2014 06:52:56 -0700 (PDT) X-Received: by 10.112.125.132 with SMTP id mq4mr3820341lbb.103.1409838776744; Thu, 04 Sep 2014 06:52:56 -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 p3sm2085260lap.14.2014.09.04.06.52.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Sep 2014 06:52:55 -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 v3 4/9] drivercore / platform: Convert to dev_pm_domain_attach|detach() Date: Thu, 4 Sep 2014 15:52:31 +0200 Message-Id: <1409838756-31963-5-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1409838756-31963-1-git-send-email-ulf.hansson@linaro.org> References: <1409838756-31963-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.178 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 --- 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); } /**