From patchwork Thu Jul 12 12:54:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: thomas.abraham@linaro.org X-Patchwork-Id: 9956 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 69C5E23E3D for ; Thu, 12 Jul 2012 12:40:48 +0000 (UTC) Received: from mail-gh0-f180.google.com (mail-gh0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id 24681A186C9 for ; Thu, 12 Jul 2012 12:40:48 +0000 (UTC) Received: by ghbz12 with SMTP id z12so2521696ghb.11 for ; Thu, 12 Jul 2012 05:40:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:x-auditid :from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-brightmail-tracker:x-tm-as-mml:x-gm-message-state; bh=EYStInKd2DXtcT6jGaiqsG5cKpk4YnP699XMl9dWLpE=; b=N2n8cwhKRqsU7TqQMoxmKlIQxRbJi7d5oo6hsfXF+XGLBdYGxc9h5DPm18o9335LsJ 7iUnZRgr/EhAT+Jgwv5m6t0gT+zvLslF5Vx2x6aEEpoPP9hiZR/QL6BUgheaX4MT36LH k29j+AVxThNEaPzsJ8fAdVrOcFRoUDpSRMTuV8RQCsNZIklWnSEAtWPZc8eUPRepFsWk wGLwK9Dctc1La5gLPZQJiS5bi3HVjTLAaKom1D9zMMIXF02mVeReisuS0PrvMZGsPf5E 6C9cLP5mYK/z27R+ALwidNc5W8La/glp6EypI+4ueFttyQKMa0H2yiwjTKdO06I8FGy0 c3mA== Received: by 10.50.40.193 with SMTP id z1mr17535497igk.0.1342096847380; Thu, 12 Jul 2012 05:40:47 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.241.2 with SMTP id lc2csp2588ibb; Thu, 12 Jul 2012 05:40:46 -0700 (PDT) Received: by 10.66.76.227 with SMTP id n3mr89799563paw.53.1342096846630; Thu, 12 Jul 2012 05:40:46 -0700 (PDT) Received: from mailout4.samsung.com (mailout4.samsung.com. [203.254.224.34]) by mx.google.com with ESMTP id od10si8811762pbb.291.2012.07.12.05.40.46; Thu, 12 Jul 2012 05:40:46 -0700 (PDT) Received-SPF: neutral (google.com: 203.254.224.34 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) client-ip=203.254.224.34; Authentication-Results: mx.google.com; spf=neutral (google.com: 203.254.224.34 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) smtp.mail=thomas.abraham@linaro.org Received: from epcpsbgm1.samsung.com (mailout4.samsung.com [203.254.224.34]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M71007D1SJSWY50@mailout4.samsung.com> for patches@linaro.org; Thu, 12 Jul 2012 21:40:45 +0900 (KST) X-AuditID: cbfee61a-b7f616d000004b7e-0f-4ffec5ccb2f5 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 75.9B.19326.CC5CEFF4; Thu, 12 Jul 2012 21:40:45 +0900 (KST) Received: from localhost.localdomain ([107.108.73.37]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M7100BYUSJJH720@mmp1.samsung.com> for patches@linaro.org; Thu, 12 Jul 2012 21:40:44 +0900 (KST) From: Thomas Abraham To: linux-mmc@vger.kernel.org, devicetree-discuss@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, cjb@laptop.org, grant.likely@secretlab.ca, rob.herring@calxeda.com, linux-samsung-soc@vger.kernel.org, kgene.kim@samsung.com, patches@linaro.org Subject: [PATCH v3 2/6] mmc: dw_mmc: allow probe to succeed even if one slot is initialized Date: Thu, 12 Jul 2012 18:24:24 +0530 Message-id: <1342097668-25243-3-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 In-reply-to: <1342097668-25243-1-git-send-email-thomas.abraham@linaro.org> References: <1342097668-25243-1-git-send-email-thomas.abraham@linaro.org> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrEJMWRmVeSWpSXmKPExsVy+t9jAd2zR//5G9w6z2wx5fAXFgdGjzvX 9rAFMEZx2aSk5mSWpRbp2yVwZRz9uJe1YBJvxdrDP1gaGDdxdTFyckgImEjsunSAFcIWk7hw bz0biC0ksIhRYsqDsC5GLiB7LpPEvRutYAk2AQOJRwvfsYPYIgJOEkvmTmAGKWIWuMMo8WjW SUaQhLBArMTkf5fAprIIqEq8mTkdrJlXwFPia9M5JohtShIbeo+C2ZwCXhLXV7YA1XMAbfOU ePXHYQIj7wJGhlWMoqkFyQXFSem5hnrFibnFpXnpesn5uZsYwT5/JrWDcWWDxSFGAQ5GJR7e Dwf++QuxJpYVV+YeYpTgYFYS4e3PBQrxpiRWVqUW5ccXleakFh9ilOZgURLnNfb+6i8kkJ5Y kpqdmlqQWgSTZeLglGpglFj6bpLkV4FJHLdFzKd26Zuv5Vb9qafdcGrNLLWCigLz1qYNSQ1a vGH/Q7ZO/R929/3+KusngZPnth5+sn2O0PHK3UYrDU25pPZZc07YNSGrt7JsjsM+rafy1q42 cdtfmHZ57QrVuv6lrcz5S4ziPbFOXWF5j7qjdtOTFCdE/jlxUeD90kPqSizFGYmGWsxFxYkA oSNr5/UBAAA= X-TM-AS-MML: No X-Gm-Message-State: ALoCoQm0ZqVw+wBHi/lMmdJTx/HBInWYTgCoFECOaOdwMmDQixgsuwDGESEW9dYwGYqaBVXCSqzJ Instead of aborting the probe in case a slot initialization fails, allow initialization of as many slots as possible. If there are atleast one instance of slot that is successfully initialized, allow the driver probe to succeed. Signed-off-by: Thomas Abraham --- drivers/mmc/host/dw_mmc.c | 23 +++++++++++++---------- 1 files changed, 13 insertions(+), 10 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 948a7ac..cd58063 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1939,6 +1939,7 @@ int dw_mci_probe(struct dw_mci *host) { int width, i, ret = 0; u32 fifo_size; + int init_slots = 0; if (!host->pdata || !host->pdata->init) { dev_err(host->dev, @@ -2047,10 +2048,18 @@ int dw_mci_probe(struct dw_mci *host) /* We need at least one slot to succeed */ for (i = 0; i < host->num_slots; i++) { ret = dw_mci_init_slot(host, i); - if (ret) { - ret = -ENODEV; - goto err_init_slot; - } + if (ret) + dev_dbg(host->dev, "slot %d init failed\n", i); + else + init_slots++; + } + + if (init_slots) { + dev_info(host->dev, "%d slots initialized\n", init_slots); + } else { + dev_dbg(host->dev, "attempted to initialize %d slots, " + "but failed on all\n", host->num_slots); + goto err_init_slot; } /* @@ -2085,12 +2094,6 @@ int dw_mci_probe(struct dw_mci *host) return 0; err_init_slot: - /* De-init any initialized slots */ - while (i > 0) { - if (host->slot[i]) - dw_mci_cleanup_slot(host->slot[i], i); - i--; - } free_irq(host->irq, host); err_workqueue: