Message ID | 1426261429-31883-5-git-send-email-ulf.hansson@linaro.org |
---|---|
State | New |
Headers | show
Return-Path: <patchwork-forward+bncBDF57NG2XIHRBTULRSUAKGQEOC22Y6A@linaro.org> X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B2409214BF for <linaro@patches.linaro.org>; Fri, 13 Mar 2015 15:44:16 +0000 (UTC) Received: by wivr20 with SMTP id r20sf4310952wiv.0 for <linaro@patches.linaro.org>; Fri, 13 Mar 2015 08:44:14 -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=/e3HG85fCGULDXq6GOuf2XLNQljZNhBOBV3Gb6VYEsg=; b=m0Sp5eehtTfjK4sIPxrYr5w4Yr5JlErQAME9NdHmNMd+Ji8UIpnBCyc8DLoIt1yDNc 6UrHojP50ocfsv3ltCIPu0aQyEXGc2XxNXJhm6/jr0G3iTh48F8std6biavrIPzp0xS5 NDbqPHrmpDH55GSGsX5qCWYs5vHMPyO8oZm+Yv/YWb268cm5QUoRNWt4nisQG2Tar2QW hvtC1C4fZBL4BM9x5I1wOcLIks3hi1b99fvHt88ZXYO0Emvw05Qo0K8DEELoZr/w3SC4 Vz7noR/okTDyYndPTfcnMER/NVpUhve8EYHeNK1F76qOGj1zauox+ki9ens59iETEFQw 9hcw== X-Gm-Message-State: ALoCoQnVoU6uNUW8V9NvfjH1j+Hb3+Rp61tGbr03cXeag9U2dUU+WdTIW9dzDS6+dRdayl3xEX5Y X-Received: by 10.112.202.227 with SMTP id kl3mr588339lbc.2.1426261454963; Fri, 13 Mar 2015 08:44:14 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.181.137 with SMTP id dw9ls388881lac.85.gmail; Fri, 13 Mar 2015 08:44:14 -0700 (PDT) X-Received: by 10.112.225.137 with SMTP id rk9mr42407002lbc.11.1426261454672; Fri, 13 Mar 2015 08:44:14 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id 5si1649546las.0.2015.03.13.08.44.14 for <patchwork-forward@linaro.org> (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Mar 2015 08:44:14 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbiw7 with SMTP id w7so23679578lbi.7 for <patchwork-forward@linaro.org>; Fri, 13 Mar 2015 08:44:14 -0700 (PDT) X-Received: by 10.112.64.193 with SMTP id q1mr44025958lbs.88.1426261454589; Fri, 13 Mar 2015 08:44:14 -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.35.133 with SMTP id h5csp1000003lbj; Fri, 13 Mar 2015 08:44:14 -0700 (PDT) X-Received: by 10.152.42.193 with SMTP id q1mr12328464lal.92.1426261454174; Fri, 13 Mar 2015 08:44:14 -0700 (PDT) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id c6si1645194lbz.38.2015.03.13.08.44.14 for <patches@linaro.org> (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Mar 2015 08:44:14 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by lams18 with SMTP id s18so23458805lam.9 for <patches@linaro.org>; Fri, 13 Mar 2015 08:44:14 -0700 (PDT) X-Received: by 10.112.147.229 with SMTP id tn5mr10334318lbb.106.1426261454084; Fri, 13 Mar 2015 08:44:14 -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 i9sm471248lbs.26.2015.03.13.08.44.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Mar 2015 08:44:13 -0700 (PDT) From: Ulf Hansson <ulf.hansson@linaro.org> To: "Rafael J. Wysocki" <rjw@rjwysocki.net>, Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>, Kevin Hilman <khilman@linaro.org>, linux-pm@vger.kernel.org Cc: Geert Uytterhoeven <geert+renesas@glider.be>, Dmitry Torokhov <dmitry.torokhov@gmail.com>, Russell King <linux@arm.linux.org.uk>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Mark Brown <broonie@kernel.org>, Wolfram Sang <wsa@the-dreams.de>, linux-arm-kernel@lists.infradead.org, Ulf Hansson <ulf.hansson@linaro.org> Subject: [PATCH 4/9] drivercore / platform: Keep PM domain powered during ->probe() Date: Fri, 13 Mar 2015 16:43:44 +0100 Message-Id: <1426261429-31883-5-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1426261429-31883-1-git-send-email-ulf.hansson@linaro.org> References: <1426261429-31883-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.170 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: <patchwork-forward.linaro.org> X-Google-Group-Id: 836684582541 List-Post: <http://groups.google.com/a/linaro.org/group/patchwork-forward/post>, <mailto:patchwork-forward@linaro.org> List-Help: <http://support.google.com/a/linaro.org/bin/topic.py?topic=25838>, <mailto:patchwork-forward+help@linaro.org> List-Archive: <http://groups.google.com/a/linaro.org/group/patchwork-forward/> List-Unsubscribe: <mailto:googlegroups-manage+836684582541+unsubscribe@googlegroups.com>, <http://groups.google.com/a/linaro.org/group/patchwork-forward/subscribe> |
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 9421fed..d35fef1 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); }
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 <ulf.hansson@linaro.org> --- drivers/base/platform.c | 7 +++++++ 1 file changed, 7 insertions(+)