[PATCH v2 3/3] fpga: socfpga-a10: Fix incorrect return value of devm_regmap_init_mmio

From: Yangtao Li
Date: Mon Jul 10 2023 - 09:39:00 EST


When devm_regmap_init_mmio fails, we should return PTR_ERR(priv->regmap)
instead of -ENODEV.

Fixes: acbb910ae04b ("fpga-manager: Add Socfpga Arria10 support")
Signed-off-by: Yangtao Li <frank.li@xxxxxxxx>
---
drivers/fpga/socfpga-a10.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/fpga/socfpga-a10.c b/drivers/fpga/socfpga-a10.c
index cc4861e345c9..b7b6e0bdb3d9 100644
--- a/drivers/fpga/socfpga-a10.c
+++ b/drivers/fpga/socfpga-a10.c
@@ -491,7 +491,7 @@ static int socfpga_a10_fpga_probe(struct platform_device *pdev)
priv->regmap = devm_regmap_init_mmio(dev, reg_base,
&socfpga_a10_fpga_regmap_config);
if (IS_ERR(priv->regmap))
- return -ENODEV;
+ return PTR_ERR(priv->regmap);

priv->clk = devm_clk_get(dev, NULL);
if (IS_ERR(priv->clk)) {
--
2.39.0