summaryrefslogtreecommitdiffstats
path: root/drivers/soc/fsl/guts.c
diff options
context:
space:
mode:
authorYang Yingliang <yangyingliang@huawei.com>2022-06-28 16:02:48 +0200
committerShawn Guo <shawnguo@kernel.org>2022-07-05 02:41:20 +0200
commitedf12b913abb69abce4cd6996398a4ce23e5b047 (patch)
tree8cab5fe9decbcde2824d798ad576fdb8f7ddfd21 /drivers/soc/fsl/guts.c
parentsoc: imx: imx8m-blk-ctrl: Make error prints useful (diff)
downloadlinux-edf12b913abb69abce4cd6996398a4ce23e5b047.tar.xz
linux-edf12b913abb69abce4cd6996398a4ce23e5b047.zip
soc: fsl: guts: fix return value check in fsl_guts_init()
In case of error, of_iomap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test and return -ENOMEM as error value. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Reviewed-by: Michael Walle <michael@walle.cc> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Diffstat (limited to 'drivers/soc/fsl/guts.c')
-rw-r--r--drivers/soc/fsl/guts.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/soc/fsl/guts.c b/drivers/soc/fsl/guts.c
index 27035de062f8..8038c599ad83 100644
--- a/drivers/soc/fsl/guts.c
+++ b/drivers/soc/fsl/guts.c
@@ -195,9 +195,9 @@ static int __init fsl_guts_init(void)
soc_data = match->data;
regs = of_iomap(np, 0);
- if (IS_ERR(regs)) {
+ if (!regs) {
of_node_put(np);
- return PTR_ERR(regs);
+ return -ENOMEM;
}
little_endian = of_property_read_bool(np, "little-endian");