From patchwork Wed Aug 29 10:48:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Abraham X-Patchwork-Id: 1384481 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 597BADF215 for ; Wed, 29 Aug 2012 10:30:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752871Ab2H2KaP (ORCPT ); Wed, 29 Aug 2012 06:30:15 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:8342 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752791Ab2H2KaO (ORCPT ); Wed, 29 Aug 2012 06:30:14 -0400 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M9I00F4LIHIWE11@mailout4.samsung.com>; Wed, 29 Aug 2012 19:30:13 +0900 (KST) X-AuditID: cbfee61a-b7fc66d0000043b7-5e-503def359eb7 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id C1.50.17335.53FED305; Wed, 29 Aug 2012 19:30:13 +0900 (KST) Received: from localhost.localdomain ([107.108.73.37]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M9I004F3IHPXG70@mmp2.samsung.com>; Wed, 29 Aug 2012 19:30:13 +0900 (KST) From: Thomas Abraham To: linux-mmc@vger.kernel.org, devicetree-discuss@lists.ozlabs.org Cc: will.newton@imgtec.com, cjb@laptop.org, grant.likely@secretlab.ca, rob.herring@calxeda.com, linux-samsung-soc@vger.kernel.org, kgene.kim@samsung.com, girish.shivananjappa@linaro.org, jh80.chung@samsung.com, tgih.jun@samsung.com, patches@linaro.org Subject: [PATCH v5 3/9] mmc: dw_mmc: allow probe to succeed even if one slot is initialized Date: Wed, 29 Aug 2012 16:18:09 +0530 Message-id: <1346237295-7116-4-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 In-reply-to: <1346237295-7116-1-git-send-email-thomas.abraham@linaro.org> References: <1346237295-7116-1-git-send-email-thomas.abraham@linaro.org> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrGJMWRmVeSWpSXmKPExsVy+t9jQV3T97YBBgf/CFkc+d/PaDHj/D4m ByaPz5vkAhijuGxSUnMyy1KL9O0SuDKO/eUpOMRbsfnMb7YGxrtcXYwcHBICJhLvGiW6GDmB TDGJC/fWs3UxcnEICUxnlPj8uZEFwmljkjh4ezETSBWbgIHEo4Xv2EFsEQEniSVzJzCDFDEL NDJJbFy4kw0kISwQK9GybwMjiM0ioCrxd/I9VhCbV8BD4ubDyawQ65QkNvQeBRvKKeAp8W7l FbBeIaCa3/dWsk1g5F3AyLCKUTS1ILmgOCk911CvODG3uDQvXS85P3cTI9j3z6R2MK5ssDjE KMDBqMTDe4HbNkCINbGsuDL3EKMEB7OSCG/qK6AQb0piZVVqUX58UWlOavEhRmkOFiVxXv4+ wwAhgfTEktTs1NSC1CKYLBMHp1QDo+CSJ1O13Gc/uGHGKMNye5dj7pm2AxrXd5+7IahV5Jar 0yIbVjXtUkTt3onWlh4/hA86N/07ky8hdeG2x3TOR81nPE69+GsU1XTDs+dgxHbvOVHKSzuF ts3QmHZNUFc5POHfpJ83DPY6rohKYXr9s+rHacbCf0fj/+jv/Pl19V0zqaTJ+oeXyCqxFGck GmoxFxUnAgBy/Rbr+QEAAA== Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org 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 Acked-by: Will Newton --- 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 a18e73c..227c42e 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1946,6 +1946,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, @@ -2054,10 +2055,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; } /* @@ -2092,12 +2101,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: