summaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2021-06-15 21:29:34 +0800
committerMark Brown <broonie@kernel.org>2021-06-15 16:43:01 +0100
commit70d654ea3de937d7754c107bb8eeb20e30262c89 (patch)
treea69d7ff95e8fc909c850562c92883e812cdd846a /drivers/regulator
parent8c485bedfb7852fa4de2a34aac2a6fd911f539f4 (diff)
downloadlinux-70d654ea3de937d7754c107bb8eeb20e30262c89.tar.gz
linux-70d654ea3de937d7754c107bb8eeb20e30262c89.tar.bz2
linux-70d654ea3de937d7754c107bb8eeb20e30262c89.zip
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@ingics.com> Link: https://lore.kernel.org/r/20210615132934.3453965-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/mt6315-regulator.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/regulator/mt6315-regulator.c b/drivers/regulator/mt6315-regulator.c
index 8c5d72869c2b..ebb68d3b5390 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)