From patchwork Mon Oct 13 14:02:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 38665 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A3AC12039B for ; Mon, 13 Oct 2014 14:02:49 +0000 (UTC) Received: by mail-wg0-f72.google.com with SMTP id m15sf4168051wgh.7 for ; Mon, 13 Oct 2014 07:02:48 -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=XqHeqzoHuEtempV96gev7GEtbvdqUVn0vQgoTJoSXA4=; b=B28Df6gH/jhhB9UxthikZudsoWoGwquaRvr0N41lOaIY2yVpp/Dc5khlKKEa5OFzc4 K7X/SQm0E5n9mOGqpdgjDqdaYAoz8IeuNE0oHerzBo3dA7Y/R5qA/9Q/FCLdDmlQ4Zem O13h/oFell1wJpBaTWgkdB1CU87RL+CZsvuC1MaUo/sdSBfIJ4GUp4ksK/NOjFia4Hb4 zvO7eK7peDmk23aZeLHCHjzem6zO8ViRoopsuiZVbiM/RUrUGlChhjrkQO77e2pUzqP5 wk5HWm3zsFaC+0fmTPAromcwpBHHXLKdWTb6W1qNHQU493AHvUnmXRkvRHjUmR6C+C8J fOIw== X-Gm-Message-State: ALoCoQmBLn6kf+3PWOdbuvb1Bp/V210VxGkNcDoSrOOy483ahuvaQwQP+xwBLEzbFHQuK8krgAsB X-Received: by 10.194.249.134 with SMTP id yu6mr4112423wjc.1.1413208968902; Mon, 13 Oct 2014 07:02:48 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.6.7 with SMTP id cq7ls33248lad.8.gmail; Mon, 13 Oct 2014 07:02:48 -0700 (PDT) X-Received: by 10.152.18.130 with SMTP id w2mr24819768lad.64.1413208968778; Mon, 13 Oct 2014 07:02:48 -0700 (PDT) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com [209.85.215.47]) by mx.google.com with ESMTPS id iq2si22345913lac.77.2014.10.13.07.02.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 13 Oct 2014 07:02:48 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by mail-la0-f47.google.com with SMTP id pv20so6810494lab.34 for ; Mon, 13 Oct 2014 07:02:47 -0700 (PDT) X-Received: by 10.112.62.200 with SMTP id a8mr24177537lbs.34.1413208967911; 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 c5csp220152lbz; Mon, 13 Oct 2014 07:02:47 -0700 (PDT) X-Received: by 10.194.243.230 with SMTP id xb6mr2900418wjc.100.1413208964917; Mon, 13 Oct 2014 07:02:44 -0700 (PDT) Received: from mail-wg0-f49.google.com (mail-wg0-f49.google.com. [74.125.82.49]) by mx.google.com with ESMTPS id cz3si12351969wib.83.2014.10.13.07.02.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 13 Oct 2014 07:02:44 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 74.125.82.49 as permitted sender) client-ip=74.125.82.49; Received: by mail-wg0-f49.google.com with SMTP id x12so8688240wgg.8 for ; Mon, 13 Oct 2014 07:02:44 -0700 (PDT) X-Received: by 10.180.73.103 with SMTP id k7mr917789wiv.83.1413208964701; Mon, 13 Oct 2014 07:02:44 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id fq1sm1533474wib.12.2014.10.13.07.02.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 13 Oct 2014 07:02:44 -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 7/9] mmc: core: Attach PM domain prior probing of SDIO func driver Date: Mon, 13 Oct 2014 16:02:08 +0200 Message-Id: <1413208930-26019-8-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.215.47 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: , Align the behvaior to how other buses are handling attachment of PM domains. Additionally, let's add error handling. Signed-off-by: Ulf Hansson --- drivers/mmc/core/sdio_bus.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c index 65cf7a7..ba97779 100644 --- a/drivers/mmc/core/sdio_bus.c +++ b/drivers/mmc/core/sdio_bus.c @@ -313,13 +313,19 @@ int sdio_add_func(struct sdio_func *func) dev_set_name(&func->dev, "%s:%d", mmc_card_id(func->card), func->num); sdio_acpi_set_handle(func); + + ret = dev_pm_domain_attach(&func->dev, false); + if (ret) + return ret; + ret = device_add(&func->dev); - if (ret == 0) { - sdio_func_set_present(func); - dev_pm_domain_attach(&func->dev, false); + if (ret) { + dev_pm_domain_detach(&func->dev, false); + return ret; } - return ret; + sdio_func_set_present(func); + return 0; } /*