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

mmc: tmio: remove superfluous callback wrappers

After various refactoring, we can populate the mmc_ops callbacks
directly and don't need to have wrappers for them anymore.
Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Link: https://lore.kernel.org/r/20200129203709.30493-7-wsa+renesas@sang-engineering.comSigned-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent b2dd9a13
...@@ -321,8 +321,9 @@ static unsigned int renesas_sdhi_init_tuning(struct tmio_mmc_host *host) ...@@ -321,8 +321,9 @@ static unsigned int renesas_sdhi_init_tuning(struct tmio_mmc_host *host)
SH_MOBILE_SDHI_SCC_DTCNTL_TAPNUM_MASK; SH_MOBILE_SDHI_SCC_DTCNTL_TAPNUM_MASK;
} }
static void renesas_sdhi_hs400_complete(struct tmio_mmc_host *host) static void renesas_sdhi_hs400_complete(struct mmc_host *mmc)
{ {
struct tmio_mmc_host *host = mmc_priv(mmc);
struct renesas_sdhi *priv = host_to_priv(host); struct renesas_sdhi *priv = host_to_priv(host);
sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, ~CLK_CTL_SCLKEN & sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, ~CLK_CTL_SCLKEN &
...@@ -376,8 +377,9 @@ static void renesas_sdhi_reset_scc(struct tmio_mmc_host *host, ...@@ -376,8 +377,9 @@ static void renesas_sdhi_reset_scc(struct tmio_mmc_host *host,
SH_MOBILE_SDHI_SCC_CKSEL)); SH_MOBILE_SDHI_SCC_CKSEL));
} }
static void renesas_sdhi_disable_scc(struct tmio_mmc_host *host) static void renesas_sdhi_disable_scc(struct mmc_host *mmc)
{ {
struct tmio_mmc_host *host = mmc_priv(mmc);
struct renesas_sdhi *priv = host_to_priv(host); struct renesas_sdhi *priv = host_to_priv(host);
renesas_sdhi_reset_scc(host, priv); renesas_sdhi_reset_scc(host, priv);
...@@ -412,9 +414,12 @@ static void renesas_sdhi_reset_hs400_mode(struct tmio_mmc_host *host, ...@@ -412,9 +414,12 @@ static void renesas_sdhi_reset_hs400_mode(struct tmio_mmc_host *host,
sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL)); sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL));
} }
static void renesas_sdhi_prepare_hs400_tuning(struct tmio_mmc_host *host) static int renesas_sdhi_prepare_hs400_tuning(struct mmc_host *mmc, struct mmc_ios *ios)
{ {
struct tmio_mmc_host *host = mmc_priv(mmc);
renesas_sdhi_reset_hs400_mode(host, host_to_priv(host)); renesas_sdhi_reset_hs400_mode(host, host_to_priv(host));
return 0;
} }
#define SH_MOBILE_SDHI_MAX_TAP 3 #define SH_MOBILE_SDHI_MAX_TAP 3
...@@ -899,10 +904,9 @@ int renesas_sdhi_probe(struct platform_device *pdev, ...@@ -899,10 +904,9 @@ int renesas_sdhi_probe(struct platform_device *pdev,
host->execute_tuning = renesas_sdhi_execute_tuning; host->execute_tuning = renesas_sdhi_execute_tuning;
host->check_retune = renesas_sdhi_check_scc_error; host->check_retune = renesas_sdhi_check_scc_error;
host->prepare_hs400_tuning = host->ops.prepare_hs400_tuning = renesas_sdhi_prepare_hs400_tuning;
renesas_sdhi_prepare_hs400_tuning; host->ops.hs400_downgrade = renesas_sdhi_disable_scc;
host->hs400_downgrade = renesas_sdhi_disable_scc; host->ops.hs400_complete = renesas_sdhi_hs400_complete;
host->hs400_complete = renesas_sdhi_hs400_complete;
} }
num_irqs = platform_irq_count(pdev); num_irqs = platform_irq_count(pdev);
......
...@@ -997,34 +997,7 @@ static int tmio_multi_io_quirk(struct mmc_card *card, ...@@ -997,34 +997,7 @@ static int tmio_multi_io_quirk(struct mmc_card *card,
return blk_size; return blk_size;
} }
static int tmio_mmc_prepare_hs400_tuning(struct mmc_host *mmc, static struct mmc_host_ops tmio_mmc_ops = {
struct mmc_ios *ios)
{
struct tmio_mmc_host *host = mmc_priv(mmc);
if (host->prepare_hs400_tuning)
host->prepare_hs400_tuning(host);
return 0;
}
static void tmio_mmc_hs400_downgrade(struct mmc_host *mmc)
{
struct tmio_mmc_host *host = mmc_priv(mmc);
if (host->hs400_downgrade)
host->hs400_downgrade(host);
}
static void tmio_mmc_hs400_complete(struct mmc_host *mmc)
{
struct tmio_mmc_host *host = mmc_priv(mmc);
if (host->hs400_complete)
host->hs400_complete(host);
}
static const struct mmc_host_ops tmio_mmc_ops = {
.request = tmio_mmc_request, .request = tmio_mmc_request,
.set_ios = tmio_mmc_set_ios, .set_ios = tmio_mmc_set_ios,
.get_ro = tmio_mmc_get_ro, .get_ro = tmio_mmc_get_ro,
...@@ -1033,9 +1006,6 @@ static const struct mmc_host_ops tmio_mmc_ops = { ...@@ -1033,9 +1006,6 @@ static const struct mmc_host_ops tmio_mmc_ops = {
.multi_io_quirk = tmio_multi_io_quirk, .multi_io_quirk = tmio_multi_io_quirk,
.hw_reset = tmio_mmc_hw_reset, .hw_reset = tmio_mmc_hw_reset,
.execute_tuning = tmio_mmc_execute_tuning, .execute_tuning = tmio_mmc_execute_tuning,
.prepare_hs400_tuning = tmio_mmc_prepare_hs400_tuning,
.hs400_downgrade = tmio_mmc_hs400_downgrade,
.hs400_complete = tmio_mmc_hs400_complete,
}; };
static int tmio_mmc_init_ocr(struct tmio_mmc_host *host) static int tmio_mmc_init_ocr(struct tmio_mmc_host *host)
......
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