From: Roland Stigge <stigge@antcom.de>
To: Jingoo Han <jg1.han@samsung.com>
Cc: linux-mtd@lists.infradead.org,
'Brian Norris' <computersforpeace@gmail.com>,
'David Woodhouse' <dwmw2@infradead.org>
Subject: Re: [PATCH V3 5/8] mtd: lpc32xx_slc: Use devm_*() functions
Date: Thu, 26 Dec 2013 11:30:07 +0100 [thread overview]
Message-ID: <52BC052F.2020201@antcom.de> (raw)
In-Reply-To: <007d01cf01dc$052cd1d0$0f867570$%han@samsung.com>
On 26/12/13 02:44, Jingoo Han wrote:
> Use devm_*() functions to make cleanup paths simpler.
>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Roland Stigge <stigge@antcom.de>
> ---
> No change since v2.
>
> drivers/mtd/nand/lpc32xx_slc.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/mtd/nand/lpc32xx_slc.c b/drivers/mtd/nand/lpc32xx_slc.c
> index 23e6974..5f20394 100644
> --- a/drivers/mtd/nand/lpc32xx_slc.c
> +++ b/drivers/mtd/nand/lpc32xx_slc.c
> @@ -791,8 +791,8 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
> }
> if (host->ncfg->wp_gpio == -EPROBE_DEFER)
> return -EPROBE_DEFER;
> - if (gpio_is_valid(host->ncfg->wp_gpio) &&
> - gpio_request(host->ncfg->wp_gpio, "NAND WP")) {
> + if (gpio_is_valid(host->ncfg->wp_gpio) && devm_gpio_request(&pdev->dev,
> + host->ncfg->wp_gpio, "NAND WP")) {
> dev_err(&pdev->dev, "GPIO not available\n");
> return -EBUSY;
> }
> @@ -808,7 +808,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
> mtd->dev.parent = &pdev->dev;
>
> /* Get NAND clock */
> - host->clk = clk_get(&pdev->dev, NULL);
> + host->clk = devm_clk_get(&pdev->dev, NULL);
> if (IS_ERR(host->clk)) {
> dev_err(&pdev->dev, "Clock failure\n");
> res = -ENOENT;
> @@ -927,10 +927,8 @@ err_exit3:
> dma_release_channel(host->dma_chan);
> err_exit2:
> clk_disable(host->clk);
> - clk_put(host->clk);
> err_exit1:
> lpc32xx_wp_enable(host);
> - gpio_free(host->ncfg->wp_gpio);
>
> return res;
> }
> @@ -953,9 +951,7 @@ static int lpc32xx_nand_remove(struct platform_device *pdev)
> writel(tmp, SLC_CTRL(host->io_base));
>
> clk_disable(host->clk);
> - clk_put(host->clk);
> lpc32xx_wp_enable(host);
> - gpio_free(host->ncfg->wp_gpio);
>
> return 0;
> }
>
next prev parent reply other threads:[~2013-12-26 10:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-26 1:40 [PATCH V3 1/8] mtd: docg3: Use devm_*() functions Jingoo Han
2013-12-26 1:41 ` [PATCH V3 2/8] mtd: ixp4xx: " Jingoo Han
2013-12-26 1:42 ` [PATCH V3 3/8] mtd: lantiq-flash: Use devm_kzalloc() Jingoo Han
2013-12-26 1:43 ` [PATCH V3 4/8] mtd: denali_dt: Use devm_clk_get() Jingoo Han
2013-12-26 1:44 ` [PATCH V3 5/8] mtd: lpc32xx_slc: Use devm_*() functions Jingoo Han
2013-12-26 10:30 ` Roland Stigge [this message]
2013-12-26 1:44 ` [PATCH V3 6/8] mtd: nuc900_nand: " Jingoo Han
2013-12-26 1:45 ` [PATCH V3 7/8] mtd: plat_nand: " Jingoo Han
2013-12-26 1:45 ` [PATCH V3 8/8] mtd: tmio_nand: " Jingoo Han
2014-01-08 10:31 ` Ian Molton
2014-01-03 1:24 ` [PATCH V3 1/8] mtd: docg3: " Brian Norris
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=52BC052F.2020201@antcom.de \
--to=stigge@antcom.de \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=jg1.han@samsung.com \
--cc=linux-mtd@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 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.