linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: w.sang@pengutronix.de (Wolfram Sang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V5 4/6] mmc: sdhci-esdhc: make the writel/readl as the general APIs
Date: Mon, 7 Mar 2011 11:48:33 +0100	[thread overview]
Message-ID: <20110307104833.GC3425@pengutronix.de> (raw)
In-Reply-To: <1299060283-6404-4-git-send-email-Hong-Xing.Zhu@freescale.com>

> +	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> +	struct pltfm_imx_data *imx_data =
> +				(struct pltfm_imx_data *)pltfm_host->scratchpad;
> +

Uh, no. Sorry that was a misunderstanding of this:

===
Do you means keep the u32 scratchpad, and use one u32---> pointer exchange, right?
-       u32 scratchpad; /* to handle quirks across io-accessor calls */
+       void *priv; /* to handle quirks across io-accessor calls */
===

When you said "exchanging" 'scratchpad' with a 'void *', I thought you really
meant replacing it in the struct like the diff sketches. Casting a variable to
a struct * is not a good idea. The private structure itself looks okay.

> +	struct pltfm_imx_data *imx_data;
> +
> +	imx_data = kzalloc(sizeof(struct pltfm_imx_data), GFP_KERNEL);
> +	pltfm_host->scratchpad = (u32)imx_data;
>  
>  	clk = clk_get(mmc_dev(host->mmc), NULL);
>  	if (IS_ERR(clk)) {

Do that after clk_get, otherwise you leak memory if it clk_get fails.

Regards

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110307/05e1935e/attachment-0001.sig>

  reply	other threads:[~2011-03-07 10:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-02 10:04 [PATCH V5 1/6] ARM: imx51/53: add sdhc3/4 clock Richard Zhu
2011-03-02 10:04 ` [PATCH V5 2/6] mmc: sdhci-esdhc: remove SDHCI_QUIRK_NO_CARD_NO_RESET from ESDHC_DEFAULT_QUIRKS Richard Zhu
2011-03-02 10:04 ` [PATCH V5 3/6] mmc: add the abort CMDTYE bits definition Richard Zhu
2011-03-02 10:04 ` [PATCH V5 4/6] mmc: sdhci-esdhc: make the writel/readl as the general APIs Richard Zhu
2011-03-07 10:48   ` Wolfram Sang [this message]
2011-03-02 10:04 ` [PATCH V5 5/6] mmc: sdhci-esdhc: enable esdhc on imx53 Richard Zhu
2011-03-02 10:04 ` [PATCH V5 6/6] ARM: imx53_loco: add esdhc device support Richard Zhu

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=20110307104833.GC3425@pengutronix.de \
    --to=w.sang@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).