Commit 7e9a57e6 authored by Laxman Dewangan's avatar Laxman Dewangan Committed by Mark Brown

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: default avatarLaxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 9fc3815e
...@@ -1101,7 +1101,7 @@ static struct tps65910_board *tps65910_parse_dt_reg_data( ...@@ -1101,7 +1101,7 @@ static struct tps65910_board *tps65910_parse_dt_reg_data(
matches = tps65911_matches; matches = tps65911_matches;
break; break;
default: default:
pr_err("Invalid tps chip version\n"); dev_err(&pdev->dev, "Invalid tps chip version\n");
return NULL; return NULL;
} }
...@@ -1150,12 +1150,16 @@ static __devinit int tps65910_probe(struct platform_device *pdev) ...@@ -1150,12 +1150,16 @@ static __devinit int tps65910_probe(struct platform_device *pdev)
if (!pmic_plat_data && tps65910->dev->of_node) if (!pmic_plat_data && tps65910->dev->of_node)
pmic_plat_data = tps65910_parse_dt_reg_data(pdev); pmic_plat_data = tps65910_parse_dt_reg_data(pdev);
if (!pmic_plat_data) if (!pmic_plat_data) {
dev_err(&pdev->dev, "Platform data not found\n");
return -EINVAL; return -EINVAL;
}
pmic = devm_kzalloc(&pdev->dev, sizeof(*pmic), GFP_KERNEL); pmic = devm_kzalloc(&pdev->dev, sizeof(*pmic), GFP_KERNEL);
if (!pmic) if (!pmic) {
dev_err(&pdev->dev, "Memory allocation failed for pmic\n");
return -ENOMEM; return -ENOMEM;
}
mutex_init(&pmic->mutex); mutex_init(&pmic->mutex);
pmic->mfd = tps65910; pmic->mfd = tps65910;
...@@ -1179,7 +1183,7 @@ static __devinit int tps65910_probe(struct platform_device *pdev) ...@@ -1179,7 +1183,7 @@ static __devinit int tps65910_probe(struct platform_device *pdev)
info = tps65911_regs; info = tps65911_regs;
break; break;
default: default:
pr_err("Invalid tps chip version\n"); dev_err(&pdev->dev, "Invalid tps chip version\n");
return -ENODEV; return -ENODEV;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment