Skip to content

Commit

Permalink
mfd: hi655x-pmic: Fix missing return value check for devm_regmap_init…
Browse files Browse the repository at this point in the history
…_mmio_clk

[ Upstream commit 7efd105 ]

Since devm_regmap_init_mmio_clk can fail, add return value checking.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Chen Feng <puck.chen@hisilicon.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
AxelLin authored and gregkh committed Jul 31, 2019
1 parent bd51cf6 commit 0e37704
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/mfd/hi655x-pmic.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ static int hi655x_pmic_probe(struct platform_device *pdev)

pmic->regmap = devm_regmap_init_mmio_clk(dev, NULL, base,
&hi655x_regmap_config);
if (IS_ERR(pmic->regmap))
return PTR_ERR(pmic->regmap);

regmap_read(pmic->regmap, HI655X_BUS_ADDR(HI655X_VER_REG), &pmic->ver);
if ((pmic->ver < PMU_VER_START) || (pmic->ver > PMU_VER_END)) {
Expand Down

0 comments on commit 0e37704

Please sign in to comment.