From patchwork Fri Sep 19 18:27:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 37653 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 85CD120293 for ; Fri, 19 Sep 2014 18:28:27 +0000 (UTC) Received: by mail-wg0-f71.google.com with SMTP id y10sf74045wgg.10 for ; Fri, 19 Sep 2014 11:28:26 -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=QBWyVCOZ7Gi6fqyvRk8qI/zlZMmQAas5fvmoYnla8XSZmxEVtziSeXfybmOoWHUTwY Y7IP51mmpMj7svcNJ4C6v1rv454TBs73jaVPormcDqBQnIyU80cIe1foc4dDrqJh2hsk iGAVl75L5kAlbVK66Ko6hKb2RBrYwgs/9r4Hm+Bxo6LNq8qjI/Jd8kXB0Ugo8arrKHqs Y2FSUEb5qq/ePBfx1gPerq7tJZpy1nc3axAcwXX3l+Q1OAUPpXmMX1jv3DfVjELgYnTQ lCJEjOBbmThx6zZd9lF15MEL35Nc5ehiXbWkAHCpnbnMl8hLijEt54s4J+aaFFhHosKL OjqQ== X-Gm-Message-State: ALoCoQk+N7hEAgheoGhp8aCMvnP5fibcRzlZcwhRWmBs9g9hm7GyPfj0/1C4JnPg+XGiDUkmXBpw X-Received: by 10.152.3.134 with SMTP id c6mr2251018lac.5.1411151306654; Fri, 19 Sep 2014 11:28:26 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.7.167 with SMTP id dd7ls336048lad.36.gmail; Fri, 19 Sep 2014 11:28:26 -0700 (PDT) X-Received: by 10.152.21.136 with SMTP id v8mr8514185lae.41.1411151306384; Fri, 19 Sep 2014 11:28:26 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com [209.85.215.45]) by mx.google.com with ESMTPS id jj4si3656557lbc.39.2014.09.19.11.28.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 19 Sep 2014 11:28:26 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id b17so3659121lan.4 for ; Fri, 19 Sep 2014 11:28:26 -0700 (PDT) X-Received: by 10.152.5.168 with SMTP id t8mr8293666lat.67.1411151306297; Fri, 19 Sep 2014 11:28:26 -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.112.130.169 with SMTP id of9csp989566lbb; Fri, 19 Sep 2014 11:28:25 -0700 (PDT) X-Received: by 10.70.87.207 with SMTP id ba15mr3744454pdb.55.1411151296683; Fri, 19 Sep 2014 11:28:16 -0700 (PDT) Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) by mx.google.com with ESMTPS id bh3si4316136pdb.42.2014.09.19.11.28.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 19 Sep 2014 11:28:16 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.192.174 as permitted sender) client-ip=209.85.192.174; Received: by mail-pd0-f174.google.com with SMTP id z10so425460pdj.5 for ; Fri, 19 Sep 2014 11:28:16 -0700 (PDT) X-Received: by 10.70.59.35 with SMTP id w3mr3406557pdq.51.1411151296012; Fri, 19 Sep 2014 11:28:16 -0700 (PDT) Received: from localhost.localdomain ([38.126.120.10]) by mx.google.com with ESMTPSA id ki1sm2495071pdb.59.2014.09.19.11.28.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 19 Sep 2014 11:28:15 -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 , Dmitry Torokhov , Ulf Hansson , linux-spi@vger.kernel.org Subject: [PATCH v5 08/11] spi: core: Convert to dev_pm_domain_attach|detach() Date: Fri, 19 Sep 2014 20:27:41 +0200 Message-Id: <1411151264-16245-9-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1411151264-16245-1-git-send-email-ulf.hansson@linaro.org> References: <1411151264-16245-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.215.45 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; }