From patchwork Mon Oct 15 13:15:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 1593951 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id C547ADFB34 for ; Mon, 15 Oct 2012 13:18:21 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TNkWx-0000Dp-7D; Mon, 15 Oct 2012 13:16:27 +0000 Received: from mail-we0-f177.google.com ([74.125.82.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TNkWf-00005z-Kj for linux-arm-kernel@lists.infradead.org; Mon, 15 Oct 2012 13:16:11 +0000 Received: by mail-we0-f177.google.com with SMTP id u50so3202825wey.36 for ; Mon, 15 Oct 2012 06:16:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=OH4/QYrCXhdr/yzrgsm1YGCxvxf82UnPLf0YbvxIPJA=; b=bheV3m1dwR/2Z1w8o+Ntof+F6jFex5+a8rnCGv0D/23+RqUQ6KjTiAPi109h3GSRu+ qfSTTZ/PxDJZqRozD+4brADvSEt8wjvXy5OOXkPSyu5re2aUxdcdTt5AtTwjl6bdpSfl uYun6KR5CBJGDydUg+HwNV0itw3fwWCk1C82JEO0GhmF0iBMScTn1xRhuXoL/KyuR0bu JfneVgoiKcQuIeZiMgwIpr8Q+JemHENG/cevvHFfDqOaySlHksubYnHw/F5r/wA7Rmzc evEoRs92fs565vXbbQfdBNZT6ya1HyZkG2Y/onK0Aqh4l36HF3ffl3D2ID5BCn4vHO0L W7OA== Received: by 10.216.209.167 with SMTP id s39mr7146019weo.118.1350306968101; Mon, 15 Oct 2012 06:16:08 -0700 (PDT) Received: from localhost.localdomain (cpc1-aztw13-0-0-cust473.18-1.cable.virginmedia.com. [77.102.241.218]) by mx.google.com with ESMTPS id p4sm15828402wix.0.2012.10.15.06.16.06 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 15 Oct 2012 06:16:07 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] mmc: mmci: Make use of new DT capability parsing function Date: Mon, 15 Oct 2012 14:15:59 +0100 Message-Id: <1350306959-5843-2-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1350306959-5843-1-git-send-email-lee.jones@linaro.org> References: <1350306959-5843-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQmC53e/ZENQRb3lu9ad4r79sFCKxVZ2FqaNfvq6msgJXxWNWjKmshrb3ZBWGw5ogeftgXbI X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.177 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Russell King , linus.walleij@stericsson.com, arnd@arndb.de, linux-mmc@vger.kernel.org, Chris Ball , Lee Jones X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Instead of rolling our own parsers for each new capability we wish to support, we can make use of a call-once function which parses all known capability strings and populates the necessary properties for us. All we have to do is remove our own cruft and invoke the call. Cc: Chris Ball Cc: Russell King Cc: linux-mmc@vger.kernel.org Acked-by: Linus Walleij Acked-by: Ulf Hansson Signed-off-by: Lee Jones --- drivers/mmc/host/mmci.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index edc3e9b..bc02f05 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -1227,25 +1227,7 @@ static void mmci_dt_populate_generic_pdata(struct device_node *np, if (!pdata->f_max) pr_warn("%s has no 'max-frequency' property\n", np->full_name); - if (of_get_property(np, "mmc-cap-mmc-highspeed", NULL)) - pdata->capabilities |= MMC_CAP_MMC_HIGHSPEED; - if (of_get_property(np, "mmc-cap-sd-highspeed", NULL)) - pdata->capabilities |= MMC_CAP_SD_HIGHSPEED; - - of_property_read_u32(np, "bus-width", &bus_width); - switch (bus_width) { - case 0 : - /* No bus-width supplied. */ - break; - case 4 : - pdata->capabilities |= MMC_CAP_4_BIT_DATA; - break; - case 8 : - pdata->capabilities |= MMC_CAP_8_BIT_DATA; - break; - default : - pr_warn("%s: Unsupported bus width\n", np->full_name); - } + mmc_of_populate_caps(np, &pdata->capabilities, &pdata->capabilities2); } #else static void mmci_dt_populate_generic_pdata(struct device_node *np,