* [PATCH -next] mtd: plat_nand: remove redundant return value check of platform_get_resource()
@ 2014-01-07 13:38 Wei Yongjun
2014-01-08 0:03 ` Jingoo Han
0 siblings, 1 reply; 3+ messages in thread
From: Wei Yongjun @ 2014-01-07 13:38 UTC (permalink / raw)
To: dwmw2, computersforpeace, grant.likely, robh+dt, jg1.han,
artem.bityutskiy
Cc: yongjun_wei, linux-mtd
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>
---
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);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] mtd: plat_nand: remove redundant return value check of platform_get_resource()
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
2014-01-20 19:38 ` Brian Norris
0 siblings, 1 reply; 3+ messages in thread
From: Jingoo Han @ 2014-01-08 0:03 UTC (permalink / raw)
To: 'Wei Yongjun', 'Brian Norris'
Cc: 'Artem Bityutskiy', 'Jingoo Han', yongjun_wei,
'Rob Herring', linux-mtd, 'Grant Likely',
'David Woodhouse'
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);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] mtd: plat_nand: remove redundant return value check of platform_get_resource()
2014-01-08 0:03 ` Jingoo Han
@ 2014-01-20 19:38 ` Brian Norris
0 siblings, 0 replies; 3+ messages in thread
From: Brian Norris @ 2014-01-20 19:38 UTC (permalink / raw)
To: Jingoo Han
Cc: 'Wei Yongjun', 'Artem Bityutskiy', yongjun_wei,
'Rob Herring', linux-mtd, 'Grant Likely',
'David Woodhouse'
On Wed, Jan 08, 2014 at 09:03:24AM +0900, Jingoo Han wrote:
> 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>
Pushed to l2-mtd.git. Thanks!
Brian
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-01-20 19:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2014-01-20 19:38 ` Brian Norris
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox