From patchwork Mon Oct 13 14:02:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 38662 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5EE3A2039B for ; Mon, 13 Oct 2014 14:02:42 +0000 (UTC) Received: by mail-wg0-f71.google.com with SMTP id y10sf4179500wgg.6 for ; Mon, 13 Oct 2014 07:02:41 -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=9gQj+IYnG6Pm8hQoZ2+Cy0C5oIiSK4LPGi0NYJaSy3M=; b=Pgi/YQXwOEaAe0HRePs0kBbSGBoNi8ViznLU0yQkWiUzDXS5p28sjBQbcDteyZsSsA See8QmWRuw7pHfDQP7gVVPRJSn/caB9hhMaHrTfDIAJuSsNEUmASCsuh0L1xj8Dx5R4R AZQ2cbqGCbokBiqJ5Y+fmWAGcyC4gnbQbPbbOTBE5nMLfGqFVlH1N5dPZWIcJ8YsQQUz ENcrQp0uP0Ce0aQnwrG1AcNE9tbi78FlEVE19yx3r+cFS0FJEdG+EisGv0Pt+S6WkVc+ yVStBxUVdHsd0EmqPkL8yu6q6oF12k/87kwOAVtruzX65Q0R2JSa1+7+7pN2nL5/29Cp tGKg== X-Gm-Message-State: ALoCoQlLkv2NvY0EpXGRbhFlRWxR+MoZUrqu64XZz+DiGKJGnJTHULYrh7inScZChPRDQxd6q6PD X-Received: by 10.180.96.101 with SMTP id dr5mr208462wib.0.1413208961546; Mon, 13 Oct 2014 07:02:41 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.200 with SMTP id le8ls501025lab.101.gmail; Mon, 13 Oct 2014 07:02:41 -0700 (PDT) X-Received: by 10.152.22.42 with SMTP id a10mr24445746laf.56.1413208961396; Mon, 13 Oct 2014 07:02:41 -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 xk6si22447228lbb.22.2014.10.13.07.02.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 13 Oct 2014 07:02:41 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@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 w7so6537327lbi.36 for ; Mon, 13 Oct 2014 07:02:41 -0700 (PDT) X-Received: by 10.112.14.34 with SMTP id m2mr23765069lbc.74.1413208961316; Mon, 13 Oct 2014 07:02:41 -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.112.84.229 with SMTP id c5csp220129lbz; Mon, 13 Oct 2014 07:02:40 -0700 (PDT) X-Received: by 10.180.88.102 with SMTP id bf6mr942251wib.43.1413208958154; Mon, 13 Oct 2014 07:02:38 -0700 (PDT) Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) by mx.google.com with ESMTPS id q8si17855118wjz.9.2014.10.13.07.02.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 13 Oct 2014 07:02:38 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.212.176 as permitted sender) client-ip=209.85.212.176; Received: by mail-wi0-f176.google.com with SMTP id hi2so7476149wib.15 for ; Mon, 13 Oct 2014 07:02:38 -0700 (PDT) X-Received: by 10.180.97.199 with SMTP id ec7mr944335wib.29.1413208957936; Mon, 13 Oct 2014 07:02:37 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id fq1sm1533474wib.12.2014.10.13.07.02.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 13 Oct 2014 07:02:37 -0700 (PDT) From: Ulf Hansson To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , linux-pm@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Geert Uytterhoeven , Kevin Hilman , Alan Stern , Greg Kroah-Hartman , Tomasz Figa , Simon Horman , Magnus Damm , Ben Dooks , Kukjin Kim , Philipp Zabel , Mark Brown , Wolfram Sang , Russell King , Dmitry Torokhov , Jack Dai , Jinkun Hong , Aaron Lu , Sylwester Nawrocki , Ulf Hansson Subject: [PATCH v3 4/9] drivercore / platform: Keep PM domain powered during ->probe() Date: Mon, 13 Oct 2014 16:02:05 +0200 Message-Id: <1413208930-26019-5-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1413208930-26019-1-git-send-email-ulf.hansson@linaro.org> References: <1413208930-26019-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.217.177 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: , To sucessfully probe some devices their corresponding PM domains may need to be powered. Use the dev_pm_domain_get|put() APIs, to control the behavior of the PM domain. Signed-off-by: Ulf Hansson --- drivers/base/platform.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/base/platform.c b/drivers/base/platform.c index b2afc29..43897ad 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -509,7 +509,14 @@ static int platform_drv_probe(struct device *_dev) ret = dev_pm_domain_attach(_dev, true); if (ret != -EPROBE_DEFER) { + ret = dev_pm_domain_get(_dev->pm_domain); + if (ret) { + dev_pm_domain_detach(_dev, true); + return ret; + } + ret = drv->probe(dev); + dev_pm_domain_put(_dev->pm_domain); if (ret) dev_pm_domain_detach(_dev, true); }