From patchwork Thu Aug 28 08:39:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 4799831 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3B20CC0338 for ; Thu, 28 Aug 2014 08:39:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6B95E201C7 for ; Thu, 28 Aug 2014 08:39:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A88DC20158 for ; Thu, 28 Aug 2014 08:39:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934238AbaH1Ijh (ORCPT ); Thu, 28 Aug 2014 04:39:37 -0400 Received: from mail-lb0-f182.google.com ([209.85.217.182]:55471 "EHLO mail-lb0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936426AbaH1Ij2 (ORCPT ); Thu, 28 Aug 2014 04:39:28 -0400 Received: by mail-lb0-f182.google.com with SMTP id u10so485202lbd.41 for ; Thu, 28 Aug 2014 01:39: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:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ca6XuhxaZpdAZNP4UV34Yys6mBMNCicJ18DZVd3JrDo=; b=AMPrz9ZJ6fYYxRzcQJ9HIcPPA9HLm0qhqhGV5rHgSnd8a88yqMzfLxaVNtKvC6JooH ba+cwR2RfeA37GfL6ZDC/f7i6cSFbCk1NjVohGsi/rEj9ptOoPLiFthLN5heDh85kR9z p0qXFAGKLsefca7xAn4z4256H5m0zqXXq2+01OhOyExqN/+9TCYs8BwmVyFd6Ak9dPFn Vwgxlj3Xe6TsOI9nr8ydBnqTq0o/uNTGeo6b1tLssf+cAijnB4r01e5210KNYo5mu14b rromcHFzSppK5gO1kL0O4j6oORqh1FfvxA7BCNJSSKIV9qwVjR9eshjqFZZ+JqyE6rn0 Sp4Q== X-Gm-Message-State: ALoCoQmtxZ/uDrwHf9JYZu/ot+Eoptui54iI77eOEg/GZjl1QcBg87VzpTyLIcDN87IR0LvddrB5 X-Received: by 10.152.9.100 with SMTP id y4mr2722662laa.26.1409215166905; Thu, 28 Aug 2014 01:39:26 -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 t12sm4826676lbp.44.2014.08.28.01.39.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Aug 2014 01:39:26 -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 v2 7/9] spi: core: Convert to dev_pm_domain_attach|detach() Date: Thu, 28 Aug 2014 10:39:00 +0200 Message-Id: <1409215142-8218-8-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1409215142-8218-1-git-send-email-ulf.hansson@linaro.org> References: <1409215142-8218-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=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 power domain was supported by the spi 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; }