summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfram Sang2016-12-12 20:51:20 +0100
committerUlf Hansson2017-02-13 13:19:48 +0100
commitdc9f1a8d790ee766c47eca163261225680691e64 (patch)
tree1e9f48e53e9be16a7539fdc0a51bd196d9dab058
parentmmc: tmio: use SDIO master interrupt bit only when allowed (diff)
downloadkernel-qcow2-linux-dc9f1a8d790ee766c47eca163261225680691e64.tar.gz
kernel-qcow2-linux-dc9f1a8d790ee766c47eca163261225680691e64.tar.xz
kernel-qcow2-linux-dc9f1a8d790ee766c47eca163261225680691e64.zip
mmc: sh_mobile_sdhi: simplify accessing DT data
By using the helper of_device_get_match_data(), we can skip some checking and make the code simpler. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r--drivers/mmc/host/sh_mobile_sdhi.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index d46c2d00c182..a6887cf4ce1b 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -556,8 +556,7 @@ static void sh_mobile_sdhi_enable_dma(struct tmio_mmc_host *host, bool enable)
static int sh_mobile_sdhi_probe(struct platform_device *pdev)
{
- const struct of_device_id *of_id =
- of_match_device(sh_mobile_sdhi_of_match, &pdev->dev);
+ const struct sh_mobile_sdhi_of_data *of_data = of_device_get_match_data(&pdev->dev);
struct sh_mobile_sdhi *priv;
struct tmio_mmc_data *mmc_data;
struct tmio_mmc_data *mmd = pdev->dev.platform_data;
@@ -598,9 +597,8 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
goto eprobe;
}
- if (of_id && of_id->data) {
- const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
+ if (of_data) {
mmc_data->flags |= of_data->tmio_flags;
mmc_data->ocr_mask = of_data->tmio_ocr_mask;
mmc_data->capabilities |= of_data->capabilities;
@@ -671,14 +669,10 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
if (host->mmc->caps & MMC_CAP_UHS_SDR104) {
host->mmc->caps |= MMC_CAP_HW_RESET;
- if (of_id && of_id->data) {
- const struct sh_mobile_sdhi_of_data *of_data;
- const struct sh_mobile_sdhi_scc *taps;
+ if (of_data) {
+ const struct sh_mobile_sdhi_scc *taps = of_data->taps;
bool hit = false;
- of_data = of_id->data;
- taps = of_data->taps;
-
for (i = 0; i < of_data->taps_num; i++) {
if (taps[i].clk_rate == 0 ||
taps[i].clk_rate == host->mmc->f_max) {