From patchwork Mon Oct 13 14:02:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 5076631 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 70942C11AC for ; Mon, 13 Oct 2014 14:03:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 801FA201F5 for ; Mon, 13 Oct 2014 14:03:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DD4E3201C7 for ; Mon, 13 Oct 2014 14:03:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754142AbaJMOCt (ORCPT ); Mon, 13 Oct 2014 10:02:49 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:56915 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754144AbaJMOCs (ORCPT ); Mon, 13 Oct 2014 10:02:48 -0400 Received: by mail-wi0-f171.google.com with SMTP id em10so7485253wid.10 for ; 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:from:to:cc:subject:date:message-id:in-reply-to :references; bh=smff/u15brtOK2tNGbN18XvxLrjQXNAVKhEBM1siEq4=; b=Ar5KBOrlt8o5CG6mRyEaJb59rRibjmvca0WygcLTd7rcbVI1fLz80WIMJ47U4TOOPr uaprw+iA8QRSSFWS1QXZq4fI6KxNcUQW0VJzdFyP1ZusrtGf1pCZ4IG1kskaKhk+grxV xdvtGJWXcbA+VpoCughUHrRA3VcbFetMoWNy6dPcN1a1plyCDkl0e7atGOp5lAqFnuWg VaBbAK2OxP2YMFXRtnHjPBBQF0Iad4sjRiHQFEN9XBohWivB1l2Xo+1ZGA3+g+AE4EWx bBXAgbRkQb6A6DT0C2H5gW9V8PBeKkCatvnPZEmgQV5mHuCDKAvnP602ov9JMMe4lUdQ kQDg== X-Gm-Message-State: ALoCoQmJaAWvPATYn9dNt4E89CjDmpnC3s25DDDmhc26PssucyAR9+h4wmvy69cJtI5wzO7SSLiU X-Received: by 10.180.8.165 with SMTP id s5mr1106167wia.4.1413208967206; Mon, 13 Oct 2014 07:02:47 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id fq1sm1533474wib.12.2014.10.13.07.02.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 13 Oct 2014 07:02:46 -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 8/9] mmmc: core: Keep PM domain powered during ->probe() of SDIO func driver Date: Mon, 13 Oct 2014 16:02:09 +0200 Message-Id: <1413208930-26019-9-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> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 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/mmc/core/sdio_bus.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c index ba97779..83c8836 100644 --- a/drivers/mmc/core/sdio_bus.c +++ b/drivers/mmc/core/sdio_bus.c @@ -318,7 +318,14 @@ int sdio_add_func(struct sdio_func *func) if (ret) return ret; + ret = dev_pm_domain_get(func->dev.pm_domain); + if (ret) { + dev_pm_domain_detach(&func->dev, false); + return ret; + } + ret = device_add(&func->dev); + dev_pm_domain_put(func->dev.pm_domain); if (ret) { dev_pm_domain_detach(&func->dev, false); return ret;