From: saeed bishara <saeed.bishara@gmail.com>
To: Matt Fleming <matt@console-pimps.org>
Cc: Saeed Bishara <saeed@marvell.com>, linux-mmc@vger.kernel.org
Subject: Re: [PATCH] MMC: add support for the Marvell platform SDHCI controller
Date: Wed, 23 Jun 2010 15:11:04 +0300 [thread overview]
Message-ID: <AANLkTimqyW5Q9YTsZ1YA0nLDXRYKuTuoaKH-C9wiQFqK@mail.gmail.com> (raw)
In-Reply-To: <87631a6k60.fsf@linux-g6p1.site>
On Wed, Jun 23, 2010 at 2:52 PM, Matt Fleming <matt@console-pimps.org> wrote:
> On Tue, 22 Jun 2010 17:09:02 +0300, Saeed Bishara <saeed@marvell.com> wrote:
>> This patch implements the driver for the platfrom SDHCI controllers that found on some of Marvell's SoC's.
>>
>> Signed-off-by: Saeed Bishara <saeed@marvell.com>
>
> That's a nice, small driver ;-)
>
> [...]
>
>> +
>> + if (!devm_request_mem_region(&pdev->dev, iomem->start,
>> + resource_size(iomem),
>> + mmc_hostname(host->mmc))) {
>> + dev_err(&pdev->dev, "cannot request region\n");
>> + ret = -EBUSY;
>> + goto err_request;
>> + }
>> +
>> + host->ioaddr = devm_ioremap(&pdev->dev, iomem->start,
>> + resource_size(iomem));
>> + if (!host->ioaddr) {
>> + dev_err(&pdev->dev, "failed to remap registers\n");
>> + ret = -ENOMEM;
>> + goto err_request;
>> + }
>
> If you fail to remap the registers shouldn't you release the mem_region
> you've allocated above?
the point behind the devm_ (device managed) resouce allocation is not
to do the free explicitly, the kernel does that on behalf of the
driver.
>
>> +
>> +#if defined(CONFIG_HAVE_CLK)
>> + mv_host->clk = clk_get(&pdev->dev, NULL);
>> + if (IS_ERR(mv_host->clk))
>> + dev_notice(&pdev->dev, "cannot get clkdev\n");
>> + else
>> + clk_enable(mv_host->clk);
>> +#endif
>> +
>> + ret = sdhci_add_host(host);
>> + if (ret)
>> + goto err_request;
>
> Likewise here, I think you should be iounmap()'ing the registers if this
> fails. Otherwise this looks good.
ditto
>
next prev parent reply other threads:[~2010-06-23 12:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-22 14:09 [PATCH] MMC: add support for the Marvell platform SDHCI controller Saeed Bishara
2010-06-23 11:52 ` Matt Fleming
2010-06-23 12:11 ` saeed bishara [this message]
2010-06-23 14:06 ` Matt Fleming
2010-08-25 22:39 ` Matt Fleming
2010-08-25 23:16 ` Andrew Morton
2010-09-10 20:16 ` Chris Ball
-- strict thread matches above, loose matches on Subject: below --
2010-10-27 8:07 Mike Rapoport
2010-10-27 8:46 ` Saeed Bishara
2010-10-27 9:17 ` Mike Rapoport
2010-10-27 9:10 ` Chris Ball
2010-05-04 16:24 Saeed Bishara
2010-05-05 13:39 ` saeed bishara
2010-05-25 7:21 ` saeed bishara
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=AANLkTimqyW5Q9YTsZ1YA0nLDXRYKuTuoaKH-C9wiQFqK@mail.gmail.com \
--to=saeed.bishara@gmail.com \
--cc=linux-mmc@vger.kernel.org \
--cc=matt@console-pimps.org \
--cc=saeed@marvell.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 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).