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: 12232 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 7D89523DE2 for ; Mon, 15 Oct 2012 13:16:11 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 3CC55A19924 for ; Mon, 15 Oct 2012 13:16:11 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id f6so3594730iag.11 for ; Mon, 15 Oct 2012 06:16:10 -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:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=OH4/QYrCXhdr/yzrgsm1YGCxvxf82UnPLf0YbvxIPJA=; b=RLFPPSFj4cXLedfNXO/C55o7VpiT+r3wCaqZzlxyzSOoPD8Pf7TWifMxzbOSG5TRhK CHOB3T4FoxLIGZWeJdlF6C1ojZoHHc2aguUw4GfBP0elgh9Os+yCMnuNUwoSt0XL9Uru SAKOvkC9qx89sqkcBNkDaRlUfTT9V0oU7H10qPeCx2YtzkU3DP7vad6e6F6Yl9CO1NI4 r1cEs7J662PrT6wEa6soGBzYjdhLZYcA1rY9l35vpPrffnCds7SMYKo/W5h1O1Yf7Un1 XeMsFfE7cEiY72KWPqTefVy5SEqUgS/HDe3Ri1TvgmDBUACdXywLI7XFJQ7osSvQS/Hx 0quQ== Received: by 10.42.57.10 with SMTP id b10mr5862169ich.54.1350306970621; Mon, 15 Oct 2012 06:16:10 -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.50.67.148 with SMTP id n20csp572792igt; Mon, 15 Oct 2012 06:16:09 -0700 (PDT) Received: by 10.216.195.144 with SMTP id p16mr6733990wen.174.1350306968774; Mon, 15 Oct 2012 06:16:08 -0700 (PDT) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by mx.google.com with ESMTPS id v6si11819129wiw.7.2012.10.15.06.16.08 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 15 Oct 2012 06:16:08 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.178 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.212.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.178 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by mail-wi0-f178.google.com with SMTP id hr7so1672396wib.13 for ; Mon, 15 Oct 2012 06:16:08 -0700 (PDT) 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 Cc: arnd@arndb.de, linus.walleij@stericsson.com, Lee Jones , Chris Ball , Russell King , linux-mmc@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: ALoCoQkkX2Cf+37YhuGETVvaElzsfT4yr8gtjxXJ36hZ1A8peZbCqZR9irgGlNlgunngnVSUuRJJ 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,