From patchwork Sun Aug 26 11:52:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Abraham X-Patchwork-Id: 1374761 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id B2A2F402E1 for ; Sun, 26 Aug 2012 11:34:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753680Ab2HZLeU (ORCPT ); Sun, 26 Aug 2012 07:34:20 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:20623 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753561Ab2HZLeS (ORCPT ); Sun, 26 Aug 2012 07:34:18 -0400 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M9D008041GZU0C0@mailout2.samsung.com>; Sun, 26 Aug 2012 20:34:18 +0900 (KST) X-AuditID: cbfee61b-b7faf6d00000476a-b0-503a09b97c15 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id E1.E9.18282.9B90A305; Sun, 26 Aug 2012 20:34:18 +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 <0M9D00AQQ1GN7UA0@mmp1.samsung.com>; Sun, 26 Aug 2012 20:34:17 +0900 (KST) From: Thomas Abraham To: linux-mmc@vger.kernel.org, devicetree-discuss@lists.ozlabs.org Cc: 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 v4 3/9] mmc: dw_mmc: allow probe to succeed even if one slot is initialized Date: Sun, 26 Aug 2012 17:22:01 +0530 Message-id: <1345981927-26359-4-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 In-reply-to: <1345981927-26359-1-git-send-email-thomas.abraham@linaro.org> References: <1345981927-26359-1-git-send-email-thomas.abraham@linaro.org> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrOJMWRmVeSWpSXmKPExsVy+t9jAd1dnFYBBk/vM1kc+d/PaDHj/D4m ByaPz5vkAhijuGxSUnMyy1KL9O0SuDKOftzLWjCJt2Lt4R8sDYybuLoYOTkkBEwk7jz6yQJh i0lcuLeerYuRi0NIYBGjxJH+NcwgCSGBNiaJu6dMQGw2AQOJRwvfsYPYIgJOEkvmTmAGaWAW eMkoMXPXTDaQhLBArMTRK//BilgEVCUmTOwFi/MKeEp0/uxjh9imJLGh9ygTiM0p4CVxY1Er O8QyT4njM74zTmDkXcDIsIpRNLUguaA4KT3XSK84Mbe4NC9dLzk/dxMj2PvPpHcwrmqwOMQo wMGoxMMrUGoZIMSaWFZcmXuIUYKDWUmE9/t+oBBvSmJlVWpRfnxRaU5q8SFGaQ4WJXFe/j7D ACGB9MSS1OzU1ILUIpgsEwenVAOjt07pOgG2Ag7byzcNtE3reF49+eN7e5+Y7u6rPJ8TuTna Iss5fnR0T76vdth47ee1FWtnz1tnItZVUH/s3M7TDS95Bdi8XBa7HuQMzHiusomrZtpGhfU+ 05kf8XIX3LPsu9wbW5brUaI9iWmlS2JYWG7gzX3rmD5OaVh46qnFyu4ZeqesOycpsRRnJBpq MRcVJwIAJDWjr/oBAAA= 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 --- 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: