From: Lee Jones <lee.jones@linaro.org>
To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: arnd@arndb.de, linus.walleij@stericsson.com,
Lee Jones <lee.jones@linaro.org>, Chris Ball <cjb@laptop.org>,
Russell King <linux@arm.linux.org.uk>,
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 [thread overview]
Message-ID: <1350306959-5843-2-git-send-email-lee.jones@linaro.org> (raw)
In-Reply-To: <1350306959-5843-1-git-send-email-lee.jones@linaro.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 <cjb@laptop.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-mmc@vger.kernel.org
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
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,
--
1.7.9.5
next prev parent reply other threads:[~2012-10-15 13:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-15 13:15 [PATCH 1/2] mmc: core: Support all MMC capabilities when booting from Device Tree Lee Jones
2012-10-15 13:15 ` Lee Jones [this message]
2012-10-15 14:20 ` Arnd Bergmann
2012-10-15 16:07 ` Lee Jones
2012-10-17 13:38 ` Arnd Bergmann
2012-10-17 18:53 ` Ulf Hansson
2012-10-17 19:56 ` Philip Rakity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1350306959-5843-2-git-send-email-lee.jones@linaro.org \
--to=lee.jones@linaro.org \
--cc=arnd@arndb.de \
--cc=cjb@laptop.org \
--cc=linus.walleij@stericsson.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®