From patchwork Thu Aug 28 08:38:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 4799811 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 23A329F375 for ; Thu, 28 Aug 2014 08:39:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 050912020F for ; Thu, 28 Aug 2014 08:39:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DC97520158 for ; Thu, 28 Aug 2014 08:39:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936411AbaH1Ije (ORCPT ); Thu, 28 Aug 2014 04:39:34 -0400 Received: from mail-la0-f47.google.com ([209.85.215.47]:63122 "EHLO mail-la0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936417AbaH1IjV (ORCPT ); Thu, 28 Aug 2014 04:39:21 -0400 Received: by mail-la0-f47.google.com with SMTP id s18so519926lam.34 for ; Thu, 28 Aug 2014 01:39:20 -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=gF2fL80BWUUKSOK2pLFCYSMThrN/LzIMBRHPRuD5mDE=; b=aLFLfp75r/RTQrd4FfVPnL05Cx1aojTUsozRX0o+bhhVHcFat/sf+XyShaIYWoUXe1 cNxu2ipnOoTF44Pl0LcX1kGFZGLSTZ1zvfif+YOMmHp2WLCyVcVsFnWtwkry+RQ5ER55 ZQkqQqRCfZCd5SVG5bYk6rVnag4+/N1P2iisKFNePuuTIKuVpiUmDofieKnnWyJ2JAdB g42oA4q8XZBFPs/01Ede34/5+Tn8p/DF2Jfh3d2RWaf2SUKGrwal9msSQrYlmiNpoxWr wTFRr3MeGG9AtAfws7ZW6hLu+labMJQBzkZtvxdE9koj7oThFGYvvFLKLm8UfEuwJgBN a6kA== X-Gm-Message-State: ALoCoQkHoJHM1ja9v2+6wOx1CLlV/VaY1DZOK6dkgeROkjzJbonR7qbqqnj3LgTH/8zRomAuoNYp X-Received: by 10.152.27.134 with SMTP id t6mr2671189lag.56.1409215159882; Thu, 28 Aug 2014 01:39:19 -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.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Aug 2014 01:39:19 -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 Subject: [PATCH v2 4/9] drivercore / platform: Convert to dev_pm_domain_attach|detach() Date: Thu, 28 Aug 2014 10:38:57 +0200 Message-Id: <1409215142-8218-5-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 platform 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. Signed-off-by: Ulf Hansson Tested-by: Philipp Zabel --- drivers/base/platform.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/base/platform.c b/drivers/base/platform.c index ab4f4ce..904be3d 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -506,11 +506,12 @@ static int platform_drv_probe(struct device *_dev) if (ret < 0) return ret; - acpi_dev_pm_attach(_dev, true); - - ret = drv->probe(dev); - if (ret) - acpi_dev_pm_detach(_dev, true); + ret = dev_pm_domain_attach(_dev, true); + if (ret != -EPROBE_DEFER) { + ret = drv->probe(dev); + if (ret) + dev_pm_domain_detach(_dev, true); + } if (drv->prevent_deferred_probe && ret == -EPROBE_DEFER) { dev_warn(_dev, "probe deferral not supported\n"); @@ -532,7 +533,7 @@ static int platform_drv_remove(struct device *_dev) int ret; ret = drv->remove(dev); - acpi_dev_pm_detach(_dev, true); + dev_pm_domain_detach(_dev, true); return ret; } @@ -543,7 +544,7 @@ static void platform_drv_shutdown(struct device *_dev) struct platform_device *dev = to_platform_device(_dev); drv->shutdown(dev); - acpi_dev_pm_detach(_dev, true); + dev_pm_domain_detach(_dev, true); } /**