Commit 7e9a57e6267591ddfdd3beaf26f21b5257c5fff8

Authored by Laxman Dewangan
Committed by Mark Brown
1 parent 9fc3815e26

regulator: tps65910: add error message in case of failure

Prints error message whenever there is failure on resource
allocation.
Also used dev_* to print messages instead of pr_*

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

Showing 1 changed file with 8 additions and 4 deletions Side-by-side Diff

drivers/regulator/tps65910-regulator.c
... ... @@ -1101,7 +1101,7 @@
1101 1101 matches = tps65911_matches;
1102 1102 break;
1103 1103 default:
1104   - pr_err("Invalid tps chip version\n");
  1104 + dev_err(&pdev->dev, "Invalid tps chip version\n");
1105 1105 return NULL;
1106 1106 }
1107 1107  
1108 1108  
1109 1109  
1110 1110  
... ... @@ -1150,12 +1150,16 @@
1150 1150 if (!pmic_plat_data && tps65910->dev->of_node)
1151 1151 pmic_plat_data = tps65910_parse_dt_reg_data(pdev);
1152 1152  
1153   - if (!pmic_plat_data)
  1153 + if (!pmic_plat_data) {
  1154 + dev_err(&pdev->dev, "Platform data not found\n");
1154 1155 return -EINVAL;
  1156 + }
1155 1157  
1156 1158 pmic = devm_kzalloc(&pdev->dev, sizeof(*pmic), GFP_KERNEL);
1157   - if (!pmic)
  1159 + if (!pmic) {
  1160 + dev_err(&pdev->dev, "Memory allocation failed for pmic\n");
1158 1161 return -ENOMEM;
  1162 + }
1159 1163  
1160 1164 mutex_init(&pmic->mutex);
1161 1165 pmic->mfd = tps65910;
... ... @@ -1179,7 +1183,7 @@
1179 1183 info = tps65911_regs;
1180 1184 break;
1181 1185 default:
1182   - pr_err("Invalid tps chip version\n");
  1186 + dev_err(&pdev->dev, "Invalid tps chip version\n");
1183 1187 return -ENODEV;
1184 1188 }
1185 1189