diff options
author | Axel Lin <axel.lin@ingics.com> | 2021-05-30 10:05:43 +0800 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-06-01 14:05:22 +0100 |
commit | 7f8c8394425fd5e1449bf0a81ab6ec718cd4346b (patch) | |
tree | 9269b3a44ca9c3335f1e3b1566472aa3276e164b | |
parent | 4c4fce171c4ca08cd98be7db350e6950630b046a (diff) |
regulator: mt6315: Don't ignore devm_regulator_register failure
Also use dev_err instead of dev_notice for messages in error conditions.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210530020543.418634-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | drivers/regulator/mt6315-regulator.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/regulator/mt6315-regulator.c b/drivers/regulator/mt6315-regulator.c index 9edc34981ee0..8c5d72869c2b 100644 --- a/drivers/regulator/mt6315-regulator.c +++ b/drivers/regulator/mt6315-regulator.c @@ -84,7 +84,7 @@ static unsigned int mt6315_regulator_get_mode(struct regulator_dev *rdev) modeset_mask = init->modeset_mask[rdev_get_id(rdev)]; ret = regmap_read(rdev->regmap, MT6315_BUCK_TOP_4PHASE_ANA_CON42, ®val); if (ret != 0) { - dev_notice(&rdev->dev, "Failed to get mode: %d\n", ret); + dev_err(&rdev->dev, "Failed to get mode: %d\n", ret); return ret; } @@ -93,7 +93,7 @@ static unsigned int mt6315_regulator_get_mode(struct regulator_dev *rdev) ret = regmap_read(rdev->regmap, MT6315_BUCK_TOP_CON1, ®val); if (ret != 0) { - dev_notice(&rdev->dev, "Failed to get lp mode: %d\n", ret); + dev_err(&rdev->dev, "Failed to get lp mode: %d\n", ret); return ret; } @@ -147,12 +147,12 @@ static int mt6315_regulator_set_mode(struct regulator_dev *rdev, break; default: ret = -EINVAL; - dev_notice(&rdev->dev, "Unsupported mode: %d\n", mode); + dev_err(&rdev->dev, "Unsupported mode: %d\n", mode); break; } if (ret != 0) { - dev_notice(&rdev->dev, "Failed to set mode: %d\n", ret); + dev_err(&rdev->dev, "Failed to set mode: %d\n", ret); return ret; } @@ -168,7 +168,7 @@ static int mt6315_get_status(struct regulator_dev *rdev) info = container_of(rdev->desc, struct mt6315_regulator_info, desc); ret = regmap_read(rdev->regmap, info->status_reg, ®val); if (ret < 0) { - dev_notice(&rdev->dev, "Failed to get enable reg: %d\n", ret); + dev_err(&rdev->dev, "Failed to get enable reg: %d\n", ret); return ret; } @@ -260,8 +260,9 @@ static int mt6315_regulator_probe(struct spmi_device *pdev) config.driver_data = init_data; rdev = devm_regulator_register(dev, &mt6315_regulators[i].desc, &config); if (IS_ERR(rdev)) { - dev_notice(dev, "Failed to register %s\n", mt6315_regulators[i].desc.name); - continue; + dev_err(dev, "Failed to register %s\n", + mt6315_regulators[i].desc.name); + return PTR_ERR(rdev); } } @@ -279,7 +280,7 @@ static void mt6315_regulator_shutdown(struct spmi_device *pdev) ret |= regmap_write(chip->regmap, MT6315_TOP_TMA_KEY, 0); ret |= regmap_write(chip->regmap, MT6315_TOP_TMA_KEY_H, 0); if (ret < 0) - dev_notice(&pdev->dev, "[%#x] Failed to enable power off sequence. %d\n", + dev_err(&pdev->dev, "[%#x] Failed to enable power off sequence. %d\n", pdev->usid, ret); } |