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: 4939471 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 005939F2EC for ; Fri, 19 Sep 2014 18:28:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1532F20204 for ; Fri, 19 Sep 2014 18:28:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 47BA42021A for ; Fri, 19 Sep 2014 18:28:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757621AbaISS2S (ORCPT ); Fri, 19 Sep 2014 14:28:18 -0400 Received: from mail-pd0-f171.google.com ([209.85.192.171]:56760 "EHLO mail-pd0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757816AbaISS2Q (ORCPT ); Fri, 19 Sep 2014 14:28:16 -0400 Received: by mail-pd0-f171.google.com with SMTP id y13so430590pdi.2 for ; Fri, 19 Sep 2014 11:28:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=l1LQv0XfO0ADxSMANGERR2rcZhcuk79Gwxr7z90N384=; b=hJX86PCPSsu6igjPgGxVqHMab/hQhIT8S4ZHg2nI3n/HZBxKGamvGo6FTKK2YXsRmy LXtIIA4N19fOoEpvJZhG2LqdkQOOyBiMiwpsE+XCglfblwDpNQx3elx+0FjMrIO4tpXR ubTubW8ESYWBSkIkzkjOiycd6yxzruw83eSKQeVYL5/OD+MmEzH+Hxqu5HMp1oRU0d/M 95QpYHWIRB1EoOqYUSq1up46e2A45iEYnuUI8Vr3qLC+GVGONGj2Sw8PN8OHEON5b49X qow0QgW+AINORv5vSUaR/GFcnoLrtHIxe1tYhThirZSzxVUFONB9QgzRnxWJ9dVtW8md lwoA== X-Gm-Message-State: ALoCoQluzI1jykJBUmKIJvZTNvO2JxlmKsRxd8EvWQgBBvJ23PoSTS3xEOoQdsAhq1yWNcmMkHG1 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> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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; }