linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: zx: Fix error handling
@ 2016-10-30  8:10 Christophe JAILLET
  2016-10-31 16:20 ` Russell King - ARM Linux
  2016-11-07 21:18 ` Olof Johansson
  0 siblings, 2 replies; 3+ messages in thread
From: Christophe JAILLET @ 2016-10-30  8:10 UTC (permalink / raw)
  To: jun.nie, linux
  Cc: linux-arm-kernel, linux-kernel, kernel-janitors, Christophe JAILLET

'devm_ioremap_resource()' returns an error pointer in case of error, not
NULL. So test it with IS_ERR.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
'return -EIO;' could also be turned into 'return PTR_ERR(pcubase);' in
order to propagate the error value.
---
 arch/arm/mach-zx/zx296702-pm-domain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-zx/zx296702-pm-domain.c b/arch/arm/mach-zx/zx296702-pm-domain.c
index e08574d4e2ca..79dcf2549267 100644
--- a/arch/arm/mach-zx/zx296702-pm-domain.c
+++ b/arch/arm/mach-zx/zx296702-pm-domain.c
@@ -169,7 +169,7 @@ static int zx296702_pd_probe(struct platform_device *pdev)
 	}
 
 	pcubase = devm_ioremap_resource(&pdev->dev, res);
-	if (!pcubase) {
+	if (IS_ERR(pcubase)) {
 		dev_err(&pdev->dev, "ioremap fail.\n");
 		return -EIO;
 	}
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ARM: zx: Fix error handling
  2016-10-30  8:10 [PATCH] ARM: zx: Fix error handling Christophe JAILLET
@ 2016-10-31 16:20 ` Russell King - ARM Linux
  2016-11-07 21:18 ` Olof Johansson
  1 sibling, 0 replies; 3+ messages in thread
From: Russell King - ARM Linux @ 2016-10-31 16:20 UTC (permalink / raw)
  To: Christophe JAILLET, arm
  Cc: jun.nie, linux-arm-kernel, linux-kernel, kernel-janitors

Same as the other fix...

On Sun, Oct 30, 2016 at 09:10:10AM +0100, Christophe JAILLET wrote:
> 'devm_ioremap_resource()' returns an error pointer in case of error, not
> NULL. So test it with IS_ERR.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> 'return -EIO;' could also be turned into 'return PTR_ERR(pcubase);' in
> order to propagate the error value.
> ---
>  arch/arm/mach-zx/zx296702-pm-domain.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-zx/zx296702-pm-domain.c b/arch/arm/mach-zx/zx296702-pm-domain.c
> index e08574d4e2ca..79dcf2549267 100644
> --- a/arch/arm/mach-zx/zx296702-pm-domain.c
> +++ b/arch/arm/mach-zx/zx296702-pm-domain.c
> @@ -169,7 +169,7 @@ static int zx296702_pd_probe(struct platform_device *pdev)
>  	}
>  
>  	pcubase = devm_ioremap_resource(&pdev->dev, res);
> -	if (!pcubase) {
> +	if (IS_ERR(pcubase)) {
>  		dev_err(&pdev->dev, "ioremap fail.\n");
>  		return -EIO;
>  	}
> -- 
> 2.9.3
> 

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ARM: zx: Fix error handling
  2016-10-30  8:10 [PATCH] ARM: zx: Fix error handling Christophe JAILLET
  2016-10-31 16:20 ` Russell King - ARM Linux
@ 2016-11-07 21:18 ` Olof Johansson
  1 sibling, 0 replies; 3+ messages in thread
From: Olof Johansson @ 2016-11-07 21:18 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: jun.nie, linux, linux-arm-kernel, linux-kernel, kernel-janitors

On Sun, Oct 30, 2016 at 09:10:10AM +0100, Christophe JAILLET wrote:
> 'devm_ioremap_resource()' returns an error pointer in case of error, not
> NULL. So test it with IS_ERR.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> 'return -EIO;' could also be turned into 'return PTR_ERR(pcubase);' in
> order to propagate the error value.

Applied to fixes-non-critical. Thanks!


-Olof

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-08  1:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-30  8:10 [PATCH] ARM: zx: Fix error handling Christophe JAILLET
2016-10-31 16:20 ` Russell King - ARM Linux
2016-11-07 21:18 ` Olof Johansson

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).