Skip to content

Commit

Permalink
regulator: mt6315: Fix checking return value of devm_regmap_init_spmi…
Browse files Browse the repository at this point in the history
…_ext

[ Upstream commit 70d654e ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
AxelLin authored and gregkh committed Jul 14, 2021
1 parent 230a4bf commit 239a5e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/regulator/mt6315-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 239a5e1

Please sign in to comment.