mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Laxman Dewangan <ldewangan@nvidia.com>
To: <lrg@ti.com>, <broonie@opensource.wolfsonmicro.com>
Cc: <linux-kernel@vger.kernel.org>, Laxman Dewangan <ldewangan@nvidia.com>
Subject: [PATCH 1/3] regulator: tps65910: add error message in case of failure
Date: Sun, 20 May 2012 21:48:48 +0530	[thread overview]
Message-ID: <1337530730-16605-2-git-send-email-ldewangan@nvidia.com> (raw)
In-Reply-To: <1337530730-16605-1-git-send-email-ldewangan@nvidia.com>

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>
---
Resend: This was sent earlier on other series as 5/5 and it
was ok but due to discussion on other patches it did not apply.
Making the changes as first of this series.

 drivers/regulator/tps65910-regulator.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c
index 57d3993..94c1801 100644
--- a/drivers/regulator/tps65910-regulator.c
+++ b/drivers/regulator/tps65910-regulator.c
@@ -1101,7 +1101,7 @@ static struct tps65910_board *tps65910_parse_dt_reg_data(
 		matches = tps65911_matches;
 		break;
 	default:
-		pr_err("Invalid tps chip version\n");
+		dev_err(&pdev->dev, "Invalid tps chip version\n");
 		return NULL;
 	}
 
@@ -1150,12 +1150,16 @@ static __devinit int tps65910_probe(struct platform_device *pdev)
 	if (!pmic_plat_data && tps65910->dev->of_node)
 		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;
+	}
 
 	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;
+	}
 
 	mutex_init(&pmic->mutex);
 	pmic->mfd = tps65910;
@@ -1179,7 +1183,7 @@ static __devinit int tps65910_probe(struct platform_device *pdev)
 		info = tps65911_regs;
 		break;
 	default:
-		pr_err("Invalid tps chip version\n");
+		dev_err(&pdev->dev, "Invalid tps chip version\n");
 		return -ENODEV;
 	}
 
-- 
1.7.1.1


  reply	other threads:[~2012-05-20 16:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-20 16:18 [PATCH] regulator: tps62360: dt: initialize of_node param for regulator register Laxman Dewangan
2012-05-20 16:18 ` Laxman Dewangan [this message]
2012-05-20 17:23   ` [PATCH 1/3] regulator: tps65910: add error message in case of failure Mark Brown
2012-05-20 16:18 ` [PATCH 2/3] regulator: tps65910: dt: support when "regulators" node found Laxman Dewangan
2012-05-20 16:18 ` [PATCH V2 3/3] regulator: tps65910: use of_node of matched regulator being register Laxman Dewangan
2012-05-20 17:23 ` [PATCH] regulator: tps62360: dt: initialize of_node param for regulator register Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1337530730-16605-2-git-send-email-ldewangan@nvidia.com \
    --to=ldewangan@nvidia.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome