From: Kevin Hao <haokexin@gmail.com>
To: linux-mmc@vger.kernel.org
Cc: Chris Ball <chris@printf.net>,
Ulf Hansson <ulf.hansson@linaro.org>,
Kevin Hao <haokexin@gmail.com>
Subject: [PATCH 2/7] mmc: sdhci-dove: kill the driver specific private struct
Date: Fri, 6 Feb 2015 11:15:17 +0800 [thread overview]
Message-ID: <1423192522-6056-3-git-send-email-haokexin@gmail.com> (raw)
In-Reply-To: <1423192522-6056-1-git-send-email-haokexin@gmail.com>
There is only one "clk" member in this driver specific private struct.
Actually we can use the "clk" member in the struct sdhci_pltfm_host,
and then kill this struct completely.
Signed-off-by: Kevin Hao <haokexin@gmail.com>
---
drivers/mmc/host/sdhci-dove.c | 26 +++++---------------------
1 file changed, 5 insertions(+), 21 deletions(-)
diff --git a/drivers/mmc/host/sdhci-dove.c b/drivers/mmc/host/sdhci-dove.c
index 0a7aeb162497..f78440ef1ba4 100644
--- a/drivers/mmc/host/sdhci-dove.c
+++ b/drivers/mmc/host/sdhci-dove.c
@@ -28,10 +28,6 @@
#include "sdhci-pltfm.h"
-struct sdhci_dove_priv {
- struct clk *clk;
-};
-
static u16 sdhci_dove_readw(struct sdhci_host *host, int reg)
{
u16 ret;
@@ -84,27 +80,17 @@ static int sdhci_dove_probe(struct platform_device *pdev)
{
struct sdhci_host *host;
struct sdhci_pltfm_host *pltfm_host;
- struct sdhci_dove_priv *priv;
int ret;
- priv = devm_kzalloc(&pdev->dev, sizeof(struct sdhci_dove_priv),
- GFP_KERNEL);
- if (!priv) {
- dev_err(&pdev->dev, "unable to allocate private data");
- return -ENOMEM;
- }
-
- priv->clk = devm_clk_get(&pdev->dev, NULL);
-
host = sdhci_pltfm_init(pdev, &sdhci_dove_pdata, 0);
if (IS_ERR(host))
return PTR_ERR(host);
pltfm_host = sdhci_priv(host);
- pltfm_host->priv = priv;
+ pltfm_host->clk = devm_clk_get(&pdev->dev, NULL);
- if (!IS_ERR(priv->clk))
- clk_prepare_enable(priv->clk);
+ if (!IS_ERR(pltfm_host->clk))
+ clk_prepare_enable(pltfm_host->clk);
ret = mmc_of_parse(host->mmc);
if (ret)
@@ -117,7 +103,7 @@ static int sdhci_dove_probe(struct platform_device *pdev)
return 0;
err_sdhci_add:
- clk_disable_unprepare(priv->clk);
+ clk_disable_unprepare(pltfm_host->clk);
sdhci_pltfm_free(pdev);
return ret;
}
@@ -126,12 +112,10 @@ static int sdhci_dove_remove(struct platform_device *pdev)
{
struct sdhci_host *host = platform_get_drvdata(pdev);
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
- struct sdhci_dove_priv *priv = pltfm_host->priv;
+ clk_disable_unprepare(pltfm_host->clk);
sdhci_pltfm_unregister(pdev);
- clk_disable_unprepare(priv->clk);
-
return 0;
}
--
1.9.3
next prev parent reply other threads:[~2015-02-06 3:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-06 3:15 [PATCH 0/7] mmc: sdhci: set .remove to sdhci_pltfm_unregister() Kevin Hao
2015-02-06 3:15 ` [PATCH 1/7] mmc: sdhci-dove: remove the unneeded error check Kevin Hao
2015-02-06 3:15 ` Kevin Hao [this message]
2015-02-06 3:15 ` [PATCH 3/7] mmc: tegra: use devm help functions to get the clk and gpio Kevin Hao
2015-02-06 3:15 ` [PATCH 4/7] mmc: sdhci-sirf: kill the "clk" member in driver private struct Kevin Hao
2015-02-06 3:15 ` [PATCH 5/7] mmc: sdhci-bcm-kona: kill the "external_clk" " Kevin Hao
2015-02-06 5:51 ` Ray Jui
2015-02-06 6:40 ` Kevin Hao
2015-02-06 3:15 ` [PATCH 6/7] mmc: sdhci: disable the clock in sdhci_pltfm_unregister() Kevin Hao
2015-02-06 3:15 ` [PATCH 7/7] mmc: sdhci: set the .remove to sdhci_pltfm_unregister() Kevin Hao
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=1423192522-6056-3-git-send-email-haokexin@gmail.com \
--to=haokexin@gmail.com \
--cc=chris@printf.net \
--cc=linux-mmc@vger.kernel.org \
--cc=ulf.hansson@linaro.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.