Message ID | 1413208930-26019-7-git-send-email-ulf.hansson@linaro.org |
---|---|
State | New |
Headers | show
Return-Path: <patchwork-forward+bncBDF57NG2XIHRBB5X56QQKGQEFW6PE3I@linaro.org> X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4E3E32039B for <linaro@patches.linaro.org>; Mon, 13 Oct 2014 14:02:48 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id h11sf1318737wiw.11 for <linaro@patches.linaro.org>; Mon, 13 Oct 2014 07:02:47 -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=S5bIjZOiYu0ypatf7Z+KEmTU/hSl58f3u1ba/Kim4M0=; b=km3m/lxLaAGRtOTbMNUA25ttWR/m7P/+CS3AWY6GyRmtBjHQytK+A27QYUPZ+eOYT7 p6MuE0eC3HzHokoHZXBSEz1oTvFK2J/SkH+MRUD3U4TJI3fUJ8hWGuKKZQ+zJfIXkdyo qdNaTrBcx/n5UhXfLW5thD2z52bKrBtNko3OyXXXRLY9SUr029Qk60JmcIoduxUx1583 MLnfqmwRih6E9nT/3XI/x5SVHL6hjwHl+dItROQu8XJLDG5srGiGoxmXTZ6SW+83YTaw /AFkAAl/jlzrEMjXGEyzYQb6oqwf3YedIpIDQ2m0fCYV87THRkXSLgck0ewfk1lYe62D hNDw== X-Gm-Message-State: ALoCoQluI/JOe89h5Unyb4nDL6Yei77VTsRNtEpuXV3t3yOzne9JHmR3XyujUh7e0/GTifBz9nra X-Received: by 10.112.64.10 with SMTP id k10mr9778lbs.19.1413208967493; Mon, 13 Oct 2014 07:02:47 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.97 with SMTP id r1ls464532lar.84.gmail; Mon, 13 Oct 2014 07:02:47 -0700 (PDT) X-Received: by 10.152.197.2 with SMTP id iq2mr3343609lac.87.1413208967293; Mon, 13 Oct 2014 07:02:47 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com [209.85.217.180]) by mx.google.com with ESMTPS id dl8si2970737lad.68.2014.10.13.07.02.47 for <patchwork-forward@linaro.org> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 13 Oct 2014 07:02:47 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by mail-lb0-f180.google.com with SMTP id n15so6351195lbi.25 for <patchwork-forward@linaro.org>; Mon, 13 Oct 2014 07:02:47 -0700 (PDT) X-Received: by 10.112.190.69 with SMTP id go5mr24046048lbc.32.1413208967214; Mon, 13 Oct 2014 07:02:47 -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 c5csp220148lbz; Mon, 13 Oct 2014 07:02:46 -0700 (PDT) X-Received: by 10.180.101.102 with SMTP id ff6mr1093408wib.34.1413208963234; Mon, 13 Oct 2014 07:02:43 -0700 (PDT) Received: from mail-wg0-f42.google.com (mail-wg0-f42.google.com [74.125.82.42]) by mx.google.com with ESMTPS id d4si17690894wje.123.2014.10.13.07.02.43 for <patches@linaro.org> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 13 Oct 2014 07:02:43 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 74.125.82.42 as permitted sender) client-ip=74.125.82.42; Received: by mail-wg0-f42.google.com with SMTP id z12so8618025wgg.1 for <patches@linaro.org>; Mon, 13 Oct 2014 07:02:43 -0700 (PDT) X-Received: by 10.194.237.164 with SMTP id vd4mr20569843wjc.46.1413208962498; Mon, 13 Oct 2014 07:02:42 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id fq1sm1533474wib.12.2014.10.13.07.02.40 for <multiple recipients> (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 13 Oct 2014 07:02:41 -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>, linux-pm@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Geert Uytterhoeven <geert+renesas@glider.be>, Kevin Hilman <khilman@linaro.org>, Alan Stern <stern@rowland.harvard.edu>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Tomasz Figa <tomasz.figa@gmail.com>, Simon Horman <horms@verge.net.au>, Magnus Damm <magnus.damm@gmail.com>, Ben Dooks <ben-linux@fluff.org>, Kukjin Kim <kgene.kim@samsung.com>, Philipp Zabel <philipp.zabel@gmail.com>, Mark Brown <broonie@kernel.org>, Wolfram Sang <wsa@the-dreams.de>, Russell King <linux@arm.linux.org.uk>, Dmitry Torokhov <dmitry.torokhov@gmail.com>, Jack Dai <jack.dai@rock-chips.com>, Jinkun Hong <jinkun.hong@rock-chips.com>, Aaron Lu <aaron.lu@intel.com>, Sylwester Nawrocki <s.nawrocki@samsung.com>, Ulf Hansson <ulf.hansson@linaro.org> Subject: [PATCH v3 6/9] spi: core: Keep PM domain powered during ->probe() Date: Mon, 13 Oct 2014 16:02:07 +0200 Message-Id: <1413208930-26019-7-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.180 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/spi/spi.c b/drivers/spi/spi.c index 3907f14..ad1a6f3 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -267,7 +267,14 @@ static int spi_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 = sdrv->probe(to_spi_device(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/spi/spi.c | 7 +++++++ 1 file changed, 7 insertions(+)