From: Matt Fleming <matt@console-pimps.org>
To: zhangfei gao <zhangfei.gao@gmail.com>
Cc: Chris Ball <cjb@laptop.org>,
kmpark@infradead.org, eric.y.miao@gmail.com,
Haojian Zhuang <haojian.zhuang@gmail.com>,
linux-mmc@vger.kernel.org
Subject: Re: [PATCH V2 1/1]MMC: add support of sdhci-pxa driver
Date: Tue, 5 Oct 2010 10:03:14 +0100 [thread overview]
Message-ID: <20101005090314.GD22830@console-pimps.org> (raw)
In-Reply-To: <AANLkTikK0oEwLEXaf_Q5XWi3nxoq8WKCzKiF87E_Z3k+@mail.gmail.com>
On Tue, Sep 28, 2010 at 11:23:35PM -0400, zhangfei gao wrote:
> +
> + pxa->clk = clk_get(dev, "PXA-SDHCLK");
> + if (IS_ERR(pxa->clk)) {
> + dev_err(dev, "failed to get io clock\n");
> + ret = PTR_ERR(pxa->clk);
> + goto out;
> + }
> +
> + pxa->res = request_mem_region(iomem->start, resource_size(iomem),
> + mmc_hostname(host->mmc));
> + if (!pxa->res) {
> + dev_err(&pdev->dev, "cannot request region\n");
> + ret = -EBUSY;
> + goto out;
> + }
> +
> + host->ioaddr = ioremap(iomem->start, resource_size(iomem));
> + if (!host->ioaddr) {
> + dev_err(&pdev->dev, "failed to remap registers\n");
> + ret = -ENOMEM;
> + goto out;
> + }
> +
> + host->hw_name = "MMC";
> + host->ops = &sdhci_pxa_ops;
> + host->irq = irq;
> + host->quirks = SDHCI_QUIRK_BROKEN_ADMA | SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
> +
> + if (pdata->pxa_quirk & PXA_QUIRK_BROKEN_CARD_DETECTION)
> + host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
I don't think there's a good reason to define
PXA_QUIRK_BROKEN_CARD_DETECTION because its only use is to turn on
SDHCI_QUIRK_BROKEN_CARD_DETECTION. As Eric pointed out, you should
just use SDHCI_QUIRK_BROKEN_CARD_DETECTION directly. While adding new
sdhci quirks should be avoided, using the existing ones is fine :-)
> +
> + ret = sdhci_add_host(host);
> + if (ret) {
> + dev_err(&pdev->dev, "failed to add host\n");
> + goto out;
> + }
> +
> + if (pxa->pdata->max_speed)
> + host->mmc->f_max = pxa->pdata->max_speed;
> +
> + platform_set_drvdata(pdev, host);
> +
> + return 0;
> +out:
> + if (host) {
> + if (host->ioaddr)
> + iounmap(host->ioaddr);
> + if (pxa->res)
> + release_mem_region(pxa->res->start,
> + resource_size(pxa->res));
> + sdhci_free_host(host);
> + }
Aren't you missing a clk_put() here?
next prev parent reply other threads:[~2010-10-05 9:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-29 3:23 [PATCH V2 1/1]MMC: add support of sdhci-pxa driver zhangfei gao
2010-10-05 9:03 ` Matt Fleming [this message]
2010-10-18 12:23 ` zhangfei gao
2010-10-07 19:45 ` Chris Ball
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=20101005090314.GD22830@console-pimps.org \
--to=matt@console-pimps.org \
--cc=cjb@laptop.org \
--cc=eric.y.miao@gmail.com \
--cc=haojian.zhuang@gmail.com \
--cc=kmpark@infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=zhangfei.gao@gmail.com \
/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.