public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Jingoo Han <jg1.han@samsung.com>
To: 'Wei Yongjun' <weiyj.lk@gmail.com>,
	'Brian Norris' <computersforpeace@gmail.com>
Cc: 'Artem Bityutskiy' <artem.bityutskiy@linux.intel.com>,
	'Jingoo Han' <jg1.han@samsung.com>,
	yongjun_wei@trendmicro.com.cn, 'Rob Herring' <robh+dt@kernel.org>,
	linux-mtd@lists.infradead.org,
	'Grant Likely' <grant.likely@linaro.org>,
	'David Woodhouse' <dwmw2@infradead.org>
Subject: Re: [PATCH -next] mtd: plat_nand: remove redundant return value check of platform_get_resource()
Date: Wed, 08 Jan 2014 09:03:24 +0900	[thread overview]
Message-ID: <001501cf0c05$0ca196c0$25e4c440$%han@samsung.com> (raw)
In-Reply-To: <CAPgLHd-2rHs_v0=tsnG08oJqaf1YmF2peeB_6KJQRnwK6r2N+w@mail.gmail.com>

On Tuesday, January 07, 2014 10:38 PM, Wei Yongjun wrote:
> 
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Remove unneeded error handling on the result of a call
> to platform_get_resource() when the value is passed to
> devm_ioremap_resource(). And move those two call together
> to make the connection between them more clear.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Reviewed-by: Jingoo Han <jg1.han@samsung.com>

Best regards,
Jingoo Han

> ---
>  drivers/mtd/nand/plat_nand.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/mtd/nand/plat_nand.c b/drivers/mtd/nand/plat_nand.c
> index 4ebed72..0b068a5 100644
> --- a/drivers/mtd/nand/plat_nand.c
> +++ b/drivers/mtd/nand/plat_nand.c
> @@ -48,16 +48,13 @@ static int plat_nand_probe(struct platform_device *pdev)
>  		return -EINVAL;
>  	}
> 
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (!res)
> -		return -ENXIO;
> -
>  	/* Allocate memory for the device structure (and zero it) */
>  	data = devm_kzalloc(&pdev->dev, sizeof(struct plat_nand_data),
>  			    GFP_KERNEL);
>  	if (!data)
>  		return -ENOMEM;
> 
> +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	data->io_base = devm_ioremap_resource(&pdev->dev, res);
>  	if (IS_ERR(data->io_base))
>  		return PTR_ERR(data->io_base);

  reply	other threads:[~2014-01-08  0:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-07 13:38 [PATCH -next] mtd: plat_nand: remove redundant return value check of platform_get_resource() Wei Yongjun
2014-01-08  0:03 ` Jingoo Han [this message]
2014-01-20 19:38   ` 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='001501cf0c05$0ca196c0$25e4c440$%han@samsung.com' \
    --to=jg1.han@samsung.com \
    --cc=artem.bityutskiy@linux.intel.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=grant.likely@linaro.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=robh+dt@kernel.org \
    --cc=weiyj.lk@gmail.com \
    --cc=yongjun_wei@trendmicro.com.cn \
    /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