From patchwork Thu Sep 4 13:52:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 36712 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 3A68520CBB for ; Thu, 4 Sep 2014 13:53:08 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id wp18sf52395655obc.9 for ; Thu, 04 Sep 2014 06:53:07 -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=AvLGS5cdgtxghjsquXmqa+Aw4Z/u5hSQpi1jW/Y0YgI=; b=D4DiPLNO8p6HBH/WYJ+hp76ERwwO2UQwIwEPPu/qOpbQIoCwO5ZA2PFoQPfA8RZY+U GwIV44+GWoIAfc7o/NPpzhsDHQra3iKI+IoPg2NLN8wQLMT171g/ztalsybmcj28O3tF 0PQdRA33G5H8gzk8/h/7p15uwjSKVdz1cNz3DG/QSnpLDdObei27Dh7c+GtmlmQqpI8J DLJ4lI81/qs4cBadJRl+bvh2iGV0AUCcrLyqW7rfabRYWqMEqptdnGM3QFjdfJJak9GK xO8PEceDenPT6igKZGr0vNyQBqBc8JkbxNWdnxBMRgLN+5GknMOKAmaBThdYCFayNGDq H9bw== X-Gm-Message-State: ALoCoQm3E0gpoqrzxWThNQD1yE4ryiMNJoED8Mm18ik+6xg+UrE1H6nbxP5OnntYrnHfkAXOieqw X-Received: by 10.50.118.100 with SMTP id kl4mr2531954igb.8.1409838787874; Thu, 04 Sep 2014 06:53:07 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.96.42 with SMTP id j39ls307451qge.89.gmail; Thu, 04 Sep 2014 06:53:07 -0700 (PDT) X-Received: by 10.52.52.136 with SMTP id t8mr3286722vdo.21.1409838787737; Thu, 04 Sep 2014 06:53:07 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id ew3si2941112vdb.11.2014.09.04.06.53.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Sep 2014 06:53:07 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id id10so10630434vcb.16 for ; Thu, 04 Sep 2014 06:53:07 -0700 (PDT) X-Received: by 10.52.119.229 with SMTP id kx5mr3272863vdb.40.1409838787664; Thu, 04 Sep 2014 06:53:07 -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 uj3csp841237vcb; Thu, 4 Sep 2014 06:53:07 -0700 (PDT) X-Received: by 10.152.43.201 with SMTP id y9mr4909031lal.54.1409838786420; Thu, 04 Sep 2014 06:53:06 -0700 (PDT) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com [209.85.217.177]) by mx.google.com with ESMTPS id qy5si2680699lbb.62.2014.09.04.06.53.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Sep 2014 06:53:06 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id z11so11658685lbi.36 for ; Thu, 04 Sep 2014 06:53:05 -0700 (PDT) X-Received: by 10.112.163.103 with SMTP id yh7mr4474644lbb.73.1409838785940; Thu, 04 Sep 2014 06:53:05 -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.53.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Sep 2014 06:53:05 -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 v3 7/9] spi: core: Convert to dev_pm_domain_attach|detach() Date: Thu, 4 Sep 2014 15:52:34 +0200 Message-Id: <1409838756-31963-8-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.171 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 --- 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; }