diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2015-01-12 23:59:43 -0500 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2015-01-20 04:23:42 -0500 |
commit | 169352500e0dc406e1d805edcb9d6d1b393d71c1 (patch) | |
tree | 021ba181e82466f72d20f3c9e2d8fe4593a1c0c2 /drivers/mmc/host | |
parent | 95a7dc364514b00a42e78ae98376d0b9f4429ac0 (diff) |
mmc: sh_mobile_sdhi: add new macro for mmc_host to sh_mobile_sdhi
getting struct sh_mobile_sdhi from struct mmc_host needs to use
complex container_of(). This patch adds new host_to_priv macro to
get it easily.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r-- | drivers/mmc/host/sh_mobile_sdhi.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c index 26eeeb690061..bcdadb9503cf 100644 --- a/drivers/mmc/host/sh_mobile_sdhi.c +++ b/drivers/mmc/host/sh_mobile_sdhi.c | |||
@@ -35,6 +35,8 @@ | |||
35 | 35 | ||
36 | #define EXT_ACC 0xe4 | 36 | #define EXT_ACC 0xe4 |
37 | 37 | ||
38 | #define host_to_priv(host) container_of((host)->pdata, struct sh_mobile_sdhi, mmc_data) | ||
39 | |||
38 | struct sh_mobile_sdhi_of_data { | 40 | struct sh_mobile_sdhi_of_data { |
39 | unsigned long tmio_flags; | 41 | unsigned long tmio_flags; |
40 | unsigned long capabilities; | 42 | unsigned long capabilities; |
@@ -88,7 +90,7 @@ static int sh_mobile_sdhi_clk_enable(struct platform_device *pdev, unsigned int | |||
88 | { | 90 | { |
89 | struct mmc_host *mmc = platform_get_drvdata(pdev); | 91 | struct mmc_host *mmc = platform_get_drvdata(pdev); |
90 | struct tmio_mmc_host *host = mmc_priv(mmc); | 92 | struct tmio_mmc_host *host = mmc_priv(mmc); |
91 | struct sh_mobile_sdhi *priv = container_of(host->pdata, struct sh_mobile_sdhi, mmc_data); | 93 | struct sh_mobile_sdhi *priv = host_to_priv(host); |
92 | int ret = clk_prepare_enable(priv->clk); | 94 | int ret = clk_prepare_enable(priv->clk); |
93 | if (ret < 0) | 95 | if (ret < 0) |
94 | return ret; | 96 | return ret; |
@@ -101,7 +103,7 @@ static void sh_mobile_sdhi_clk_disable(struct platform_device *pdev) | |||
101 | { | 103 | { |
102 | struct mmc_host *mmc = platform_get_drvdata(pdev); | 104 | struct mmc_host *mmc = platform_get_drvdata(pdev); |
103 | struct tmio_mmc_host *host = mmc_priv(mmc); | 105 | struct tmio_mmc_host *host = mmc_priv(mmc); |
104 | struct sh_mobile_sdhi *priv = container_of(host->pdata, struct sh_mobile_sdhi, mmc_data); | 106 | struct sh_mobile_sdhi *priv = host_to_priv(host); |
105 | clk_disable_unprepare(priv->clk); | 107 | clk_disable_unprepare(priv->clk); |
106 | } | 108 | } |
107 | 109 | ||