All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Fleming <matt@console-pimps.org>
To: Saeed Bishara <saeed@marvell.com>
Cc: saeed.bishara@gmail.com, linux-mmc@vger.kernel.org
Subject: Re: [PATCH] MMC: add support for the Marvell platform SDHCI controller
Date: Wed, 23 Jun 2010 12:52:07 +0100	[thread overview]
Message-ID: <87631a6k60.fsf@linux-g6p1.site> (raw)
In-Reply-To: <1277215742-25994-1-git-send-email-saeed@marvell.com>

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?

> +
> +#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.

  reply	other threads:[~2010-06-23 11:52 UTC|newest]

Thread overview: 18+ 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 [this message]
2010-06-23 12:11   ` saeed bishara
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:07 ` Mike Rapoport
2010-10-27  8:46 ` Saeed Bishara
2010-10-27  8:46   ` Saeed Bishara
2010-10-27  9:17   ` Mike Rapoport
2010-10-27  9:17     ` Mike Rapoport
2010-10-27  9:10 ` Chris Ball
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=87631a6k60.fsf@linux-g6p1.site \
    --to=matt@console-pimps.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=saeed.bishara@gmail.com \
    --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 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.