From patchwork Tue Aug 26 12:07:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 36005 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f200.google.com (mail-ie0-f200.google.com [209.85.223.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CF9A12054F for ; Tue, 26 Aug 2014 12:08:03 +0000 (UTC) Received: by mail-ie0-f200.google.com with SMTP id at20sf47331127iec.7 for ; Tue, 26 Aug 2014 05:08: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=MBeHqXJM2nPW1cYrl9rsQK8wxdFYjRQ6eE34xPGmzv0=; b=OfkfJ6imEvtbgMFLrFdef8LvTl8eQ7dfXAQ3nSriydeHkYkzk3F96AXZQUaeR1/Yoc a+puXapLUbT34CZigG5oU9QjGOFJot8aUxU3YtZfulhRV8tyMl6q1v33hkaApi69bsDI GPOmXbIl3Z/8MlJARF210QhwxLHTbUCMc2SSv1NFRFIBZp6MmWgwmRXBP1XPwzL24zqK giXOi+oyf0jK6PpWnF5k/CLhTgQ0tBaWU2u8OgtuD5d2x7ILpRUWgm0sPWLAkDKg2WM4 L1PVbjTfWBQsIpIqUGZbtwGG+0VTcfEXL7Xun6uhs7/ssVx5Nf1vfi/UNDpUX0A/pKA/ Vfeg== X-Gm-Message-State: ALoCoQk2UHipUBLEDSYTii74Rs50JclcaDGh+OOOIQLBHRI15DXWd2v8MtQVGEaSymBAZ8a/3AJR X-Received: by 10.42.10.66 with SMTP id p2mr21801056icp.28.1409054883412; Tue, 26 Aug 2014 05:08:03 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.87.6 with SMTP id q6ls2484823qgd.82.gmail; Tue, 26 Aug 2014 05:08:03 -0700 (PDT) X-Received: by 10.220.182.1 with SMTP id ca1mr23544922vcb.21.1409054883323; Tue, 26 Aug 2014 05:08:03 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id f5si1247721vcz.99.2014.08.26.05.08.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 26 Aug 2014 05:08:03 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id hy4so16793750vcb.13 for ; Tue, 26 Aug 2014 05:08:03 -0700 (PDT) X-Received: by 10.53.2.10 with SMTP id bk10mr4617655vdd.48.1409054883260; Tue, 26 Aug 2014 05:08:03 -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 uj3csp193049vcb; Tue, 26 Aug 2014 05:08:02 -0700 (PDT) X-Received: by 10.112.134.101 with SMTP id pj5mr12630443lbb.47.1409054881183; Tue, 26 Aug 2014 05:08:01 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com [209.85.217.180]) by mx.google.com with ESMTPS id r5si3330440lal.51.2014.08.26.05.08.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 26 Aug 2014 05:08:01 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by mail-lb0-f180.google.com with SMTP id 10so1206329lbg.25 for ; Tue, 26 Aug 2014 05:08:00 -0700 (PDT) X-Received: by 10.112.50.230 with SMTP id f6mr26037989lbo.56.1409054880626; Tue, 26 Aug 2014 05:08:00 -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.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Aug 2014 05:08:00 -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 7/9] spi: core: Convert to dev_pm_domain_attach|detach() Date: Tue, 26 Aug 2014 14:07:15 +0200 Message-Id: <1409054837-5667-8-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.182 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 i2c 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. Cc: linux-spi@vger.kernel.org Signed-off-by: Ulf Hansson --- 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 e0531ba..6a7b0cc 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; }