[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210615132934.3453965-1-axel.lin@ingics.com>
Date: Tue, 15 Jun 2021 21:29:34 +0800
From: Axel Lin <axel.lin@...ics.com>
To: Mark Brown <broonie@...nel.org>
Cc: Hsin-Hsiung Wang <hsin-hsiung.wang@...iatek.com>,
Liam Girdwood <lgirdwood@...il.com>,
linux-kernel@...r.kernel.org, Axel Lin <axel.lin@...ics.com>
Subject: [PATCH] regulator: mt6315: Fix checking return value of devm_regmap_init_spmi_ext
devm_regmap_init_spmi_ext() returns ERR_PTR() on error.
Signed-off-by: Axel Lin <axel.lin@...ics.com>
---
drivers/regulator/mt6315-regulator.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/regulator/mt6315-regulator.c b/drivers/regulator/mt6315-regulator.c
index 865a292bedcb..284c229e1aa4 100644
--- a/drivers/regulator/mt6315-regulator.c
+++ b/drivers/regulator/mt6315-regulator.c
@@ -223,8 +223,8 @@ static int mt6315_regulator_probe(struct spmi_device *pdev)
int i;
regmap = devm_regmap_init_spmi_ext(pdev, &mt6315_regmap_config);
- if (!regmap)
- return -ENODEV;
+ if (IS_ERR(regmap))
+ return PTR_ERR(regmap);
chip = devm_kzalloc(dev, sizeof(struct mt6315_chip), GFP_KERNEL);
if (!chip)
--
2.25.1
Powered by blists - more mailing lists