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: 36166 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f199.google.com (mail-ie0-f199.google.com [209.85.223.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 65127202DD for ; Thu, 28 Aug 2014 08:39:29 +0000 (UTC) Received: by mail-ie0-f199.google.com with SMTP id tr6sf6333231ieb.10 for ; Thu, 28 Aug 2014 01:39:28 -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=ca6XuhxaZpdAZNP4UV34Yys6mBMNCicJ18DZVd3JrDo=; b=mqbAvo2HN6cOwIB5zQ5UlgbkJhoFIUMlV6OfFgRMFj5wXjXvOpxzLC2cHZjV3cMfry lNLvJBevew2GAlVtvX4vV+EvCCwZ62bzlMBFhEE2uDwfDssciOzS0HG61mSoDFx1cEFw DkplCMjAKfh2M3cAkEC4PJxWWXvElQXoF/jqwa7wRUdAGIKvqnQnKVjfiY7fmsGPosOn q5gir7IbC5OSzXPIeNQ78yKFyNMI/3sSh9dCR1qX2pAU+nRxPbEqIBKQHYHHrGitVN2Q A112iRhWVhLVEgOqHUqTEQo1Czj1NxkD6RW4a1pXhLK60LtiV26NgNoxfrn8WaWA8Nhg BcXw== X-Gm-Message-State: ALoCoQk4a1sh6s3FrTIFK/gs0yIvxatng6FVYlhGr7OFKW0OMNMWvE0PLAF/U/EJ894FGrGs7aaf X-Received: by 10.50.80.111 with SMTP id q15mr2131854igx.0.1409215168869; Thu, 28 Aug 2014 01:39:28 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.22.17 with SMTP id 17ls449620qgm.63.gmail; Thu, 28 Aug 2014 01:39:28 -0700 (PDT) X-Received: by 10.52.164.80 with SMTP id yo16mr43602vdb.44.1409215168766; Thu, 28 Aug 2014 01:39:28 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id ey5si2913588vcb.76.2014.08.28.01.39.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Aug 2014 01:39:28 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.169 as permitted sender) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id hq11so451414vcb.14 for ; Thu, 28 Aug 2014 01:39:28 -0700 (PDT) X-Received: by 10.52.27.16 with SMTP id p16mr1721620vdg.14.1409215168696; Thu, 28 Aug 2014 01:39:28 -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 uj3csp201175vcb; Thu, 28 Aug 2014 01:39:28 -0700 (PDT) X-Received: by 10.112.78.38 with SMTP id y6mr2467243lbw.94.1409215167452; Thu, 28 Aug 2014 01:39:27 -0700 (PDT) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx.google.com with ESMTPS id ls4si4368275lac.7.2014.08.28.01.39.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Aug 2014 01:39:27 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by mail-lb0-f182.google.com with SMTP id u10so498422lbd.13 for ; Thu, 28 Aug 2014 01:39:26 -0700 (PDT) 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> 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.169 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 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; }