Commit dc9f1a8d authored by Wolfram Sang's avatar Wolfram Sang Committed by Ulf Hansson

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: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent c51ff6c6
...@@ -556,8 +556,7 @@ static void sh_mobile_sdhi_enable_dma(struct tmio_mmc_host *host, bool enable) ...@@ -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) static int sh_mobile_sdhi_probe(struct platform_device *pdev)
{ {
const struct of_device_id *of_id = const struct sh_mobile_sdhi_of_data *of_data = of_device_get_match_data(&pdev->dev);
of_match_device(sh_mobile_sdhi_of_match, &pdev->dev);
struct sh_mobile_sdhi *priv; struct sh_mobile_sdhi *priv;
struct tmio_mmc_data *mmc_data; struct tmio_mmc_data *mmc_data;
struct tmio_mmc_data *mmd = pdev->dev.platform_data; struct tmio_mmc_data *mmd = pdev->dev.platform_data;
...@@ -598,9 +597,8 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) ...@@ -598,9 +597,8 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
goto eprobe; 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->flags |= of_data->tmio_flags;
mmc_data->ocr_mask = of_data->tmio_ocr_mask; mmc_data->ocr_mask = of_data->tmio_ocr_mask;
mmc_data->capabilities |= of_data->capabilities; mmc_data->capabilities |= of_data->capabilities;
...@@ -671,14 +669,10 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) ...@@ -671,14 +669,10 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
if (host->mmc->caps & MMC_CAP_UHS_SDR104) { if (host->mmc->caps & MMC_CAP_UHS_SDR104) {
host->mmc->caps |= MMC_CAP_HW_RESET; host->mmc->caps |= MMC_CAP_HW_RESET;
if (of_id && of_id->data) { if (of_data) {
const struct sh_mobile_sdhi_of_data *of_data; const struct sh_mobile_sdhi_scc *taps = of_data->taps;
const struct sh_mobile_sdhi_scc *taps;
bool hit = false; bool hit = false;
of_data = of_id->data;
taps = of_data->taps;
for (i = 0; i < of_data->taps_num; i++) { for (i = 0; i < of_data->taps_num; i++) {
if (taps[i].clk_rate == 0 || if (taps[i].clk_rate == 0 ||
taps[i].clk_rate == host->mmc->f_max) { taps[i].clk_rate == host->mmc->f_max) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment