From: Andreas Fenkart <afenkart@gmail.com>
To: linux-mmc@vger.kernel.org
Cc: linux-omap@vger.kernel.org, "Tony Lindgren" <tony@atomide.com>,
"Benoît Cousson" <bcousson@baylibre.com>,
"Ulf Hansson" <ulf.hansson@linaro.org>,
pascal.huerst@gmail.com, "Andreas Fenkart" <afenkart@gmail.com>
Subject: [PATCH v4 08/10] omap_hsmmc: pass mmc_priv struct to gpio init / free
Date: Sat, 8 Nov 2014 15:33:15 +0100 [thread overview]
Message-ID: <1415457197-14294-9-git-send-email-afenkart@gmail.com> (raw)
In-Reply-To: <1415457197-14294-1-git-send-email-afenkart@gmail.com>
this is needed when installing callbacks in the host struct and not
in the platform data, e.g. cover detect irq should be stored in
omap_hsmmc_host and not platform data
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Andreas Fenkart <afenkart@gmail.com>
---
drivers/mmc/host/omap_hsmmc.c | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 291b9e1..8a216c9 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -449,7 +449,8 @@ static inline int omap_hsmmc_have_reg(void)
#endif
-static int omap_hsmmc_gpio_init(struct omap_hsmmc_platform_data *pdata)
+static int omap_hsmmc_gpio_init(struct omap_hsmmc_host *host,
+ struct omap_hsmmc_platform_data *pdata)
{
int ret;
@@ -494,7 +495,8 @@ err_free_sp:
return ret;
}
-static void omap_hsmmc_gpio_free(struct omap_hsmmc_platform_data *pdata)
+static void omap_hsmmc_gpio_free(struct omap_hsmmc_host *host,
+ struct omap_hsmmc_platform_data *pdata)
{
if (gpio_is_valid(pdata->gpio_wp))
gpio_free(pdata->gpio_wp);
@@ -2064,14 +2066,10 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
if (IS_ERR(base))
return PTR_ERR(base);
- ret = omap_hsmmc_gpio_init(pdata);
- if (ret)
- goto err;
-
mmc = mmc_alloc_host(sizeof(struct omap_hsmmc_host), &pdev->dev);
if (!mmc) {
ret = -ENOMEM;
- goto err_alloc;
+ goto err;
}
host = mmc_priv(mmc);
@@ -2088,6 +2086,10 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
host->next_data.cookie = 1;
host->pbias_enabled = 0;
+ ret = omap_hsmmc_gpio_init(host, pdata);
+ if (ret)
+ goto err_gpio;
+
platform_set_drvdata(pdev, host);
if (pdev->dev.of_node)
@@ -2283,9 +2285,9 @@ err_irq:
if (host->dbclk)
clk_disable_unprepare(host->dbclk);
err1:
+ omap_hsmmc_gpio_free(host, pdata);
+err_gpio:
mmc_free_host(mmc);
-err_alloc:
- omap_hsmmc_gpio_free(pdata);
err:
return ret;
}
@@ -2309,7 +2311,7 @@ static int omap_hsmmc_remove(struct platform_device *pdev)
if (host->dbclk)
clk_disable_unprepare(host->dbclk);
- omap_hsmmc_gpio_free(host->pdata);
+ omap_hsmmc_gpio_free(host, host->pdata);
mmc_free_host(host->mmc);
return 0;
--
2.1.1
next prev parent reply other threads:[~2014-11-08 14:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-08 14:33 [PATCH v4 00/10] ARM: OMAP1/2+: MMC: separate platform data for mmc and mmc hs driver Andreas Fenkart
2014-11-08 14:33 ` [PATCH v4 01/10] ARM: OMAP2: MMC: include mmc-omap platform header directly Andreas Fenkart
2014-11-08 14:33 ` [PATCH v4 02/10] ARM: OMAP1/2+: MMC: separate platform data for mmc and mmc hs driver Andreas Fenkart
2014-11-08 14:33 ` [PATCH v4 03/10] omap_hsmmc: remove unused fields in platform_data Andreas Fenkart
2014-11-08 14:33 ` [PATCH v4 04/10] omap_hsmmc: remove un-initialized callbacks from platform data Andreas Fenkart
2014-11-08 14:33 ` [PATCH v4 05/10] omap_hsmmc: remove never read power_saving field in omap2_hsmmc_info Andreas Fenkart
2014-11-08 14:33 ` [PATCH v4 06/10] omap_hsmmc: remove unused get_context_loss_count callback Andreas Fenkart
2014-11-08 14:33 ` [PATCH v4 07/10] omap_hsmmc: remove unnecessary omap_hsmmc_slot_data indirection Andreas Fenkart
2014-11-08 14:33 ` Andreas Fenkart [this message]
2014-11-08 14:33 ` [PATCH v4 09/10] omap_hsmmc: Remove unnecessary callbacks from platform data Andreas Fenkart
2014-11-08 14:33 ` [PATCH v4 10/10] omap_hsmmc: remove unused slot_id parameter Andreas Fenkart
2014-11-10 12:07 ` [PATCH v4 00/10] ARM: OMAP1/2+: MMC: separate platform data for mmc and mmc hs driver Ulf Hansson
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=1415457197-14294-9-git-send-email-afenkart@gmail.com \
--to=afenkart@gmail.com \
--cc=bcousson@baylibre.com \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=pascal.huerst@gmail.com \
--cc=tony@atomide.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox