* [PATCH] regulator: stm32-pwr: Fix error checking for of_iomap
@ 2019-04-17 8:43 Axel Lin
2019-04-17 16:36 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2019-04-17 8:43 UTC (permalink / raw)
To: Mark Brown; +Cc: Pascal Paillet, Liam Girdwood, linux-kernel, Axel Lin
of_iomap returns NULL on error.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/regulator/stm32-pwr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/regulator/stm32-pwr.c b/drivers/regulator/stm32-pwr.c
index 222d593d76a2..dd5c2b383e5b 100644
--- a/drivers/regulator/stm32-pwr.c
+++ b/drivers/regulator/stm32-pwr.c
@@ -140,9 +140,9 @@ static int stm32_pwr_regulator_probe(struct platform_device *pdev)
int i, ret = 0;
base = of_iomap(np, 0);
- if (IS_ERR(base)) {
+ if (!base) {
dev_err(&pdev->dev, "Unable to map IO memory\n");
- return PTR_ERR(base);
+ return -ENODEV;
}
config.dev = &pdev->dev;
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] regulator: stm32-pwr: Fix error checking for of_iomap
2019-04-17 8:43 [PATCH] regulator: stm32-pwr: Fix error checking for of_iomap Axel Lin
@ 2019-04-17 16:36 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2019-04-17 16:36 UTC (permalink / raw)
To: Axel Lin; +Cc: Pascal Paillet, Liam Girdwood, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 132 bytes --]
On Wed, Apr 17, 2019 at 04:43:35PM +0800, Axel Lin wrote:
> of_iomap returns NULL on error.
Someone already sent a patch for this.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-04-17 16:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-17 8:43 [PATCH] regulator: stm32-pwr: Fix error checking for of_iomap Axel Lin
2019-04-17 16:36 ` Mark Brown
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).