From patchwork Tue Sep 9 11:36:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 37101 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5921E20C93 for ; Tue, 9 Sep 2014 11:37:03 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id wp18sf81948748obc.1 for ; Tue, 09 Sep 2014 04:37:03 -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=l1LQv0XfO0ADxSMANGERR2rcZhcuk79Gwxr7z90N384=; b=jWmwFPaz2YBFyWdkXU0Mk/PJfliG0yC9tn4W0jwl2p7L5deOUI5a1blyitc/bd0Xm4 zFnSmgoU3+aVv1WROk3TmaXy+4h/Tt9Kxtxz42inNEoLEzW31MEohK/MytwbZNrJQ4Ez S5n9fVWeZPSB0G59npPw3z5Kpjb2gn7dgPJrceORX6D2nYXO384UBu+793QabzOVD7Ge v0BdoFMgSd5GwWpWevkCmwamuCqP/DwER4mXrwymOdBKyzx3zLYqqKZlmFHty5cv5Pkn QmPV6tAODyWETHk8NZyiOlpAqZ5ydhDTcKcnbB3wl7NCrqS7jsZqBkkFYuQjnF3gEzd4 skzg== X-Gm-Message-State: ALoCoQk82No6mNic6fcvjgRisxonU+dK3+W3VL+N+uNIniGGy51G4R8fMJsf3bcRAqcP8YryfLOn X-Received: by 10.42.119.82 with SMTP id a18mr21511088icr.19.1410262622935; Tue, 09 Sep 2014 04:37:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.107.70 with SMTP id g64ls2197501qgf.85.gmail; Tue, 09 Sep 2014 04:37:02 -0700 (PDT) X-Received: by 10.52.28.146 with SMTP id b18mr4523148vdh.55.1410262622856; Tue, 09 Sep 2014 04:37:02 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id ir4si5058555vcb.19.2014.09.09.04.37.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 09 Sep 2014 04:37:02 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id lf12so16664596vcb.20 for ; Tue, 09 Sep 2014 04:37:02 -0700 (PDT) X-Received: by 10.52.35.105 with SMTP id g9mr1324679vdj.61.1410262622776; Tue, 09 Sep 2014 04:37:02 -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 uj3csp270224vcb; Tue, 9 Sep 2014 04:37:02 -0700 (PDT) X-Received: by 10.152.87.97 with SMTP id w1mr2358942laz.92.1410262620165; Tue, 09 Sep 2014 04:37:00 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com [209.85.215.53]) by mx.google.com with ESMTPS id ug4si17592671lbc.5.2014.09.09.04.36.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 09 Sep 2014 04:37:00 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id ge10so1679974lab.40 for ; Tue, 09 Sep 2014 04:36:59 -0700 (PDT) X-Received: by 10.152.42.209 with SMTP id q17mr1041385lal.13.1410262619614; Tue, 09 Sep 2014 04:36:59 -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.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Sep 2014 04:36:58 -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 , linux-spi@vger.kernel.org Subject: [PATCH v4 7/9] spi: core: Convert to dev_pm_domain_attach|detach() Date: Tue, 9 Sep 2014 13:36:08 +0200 Message-Id: <1410262570-22785-8-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.175 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 spi 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. Cc: linux-spi@vger.kernel.org Signed-off-by: Ulf Hansson Reviewed-by: Kevin Hilman --- drivers/spi/spi.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index ca935df..72a0beb 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -264,10 +264,12 @@ static int spi_drv_probe(struct device *dev) if (ret) return ret; - acpi_dev_pm_attach(dev, true); - ret = sdrv->probe(to_spi_device(dev)); - if (ret) - acpi_dev_pm_detach(dev, true); + ret = dev_pm_domain_attach(dev, true); + if (ret != -EPROBE_DEFER) { + ret = sdrv->probe(to_spi_device(dev)); + if (ret) + dev_pm_domain_detach(dev, true); + } return ret; } @@ -278,7 +280,7 @@ static int spi_drv_remove(struct device *dev) int ret; ret = sdrv->remove(to_spi_device(dev)); - acpi_dev_pm_detach(dev, true); + dev_pm_domain_detach(dev, true); return ret; }