public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Laxman Dewangan <ldewangan@nvidia.com>
To: <sameo@linux.intel.com>
Cc: <linux-kernel@vger.kernel.org>,
	<broonie@opensource.wolfsonmicro.com>,
	Laxman Dewangan <ldewangan@nvidia.com>
Subject: [PATCH RESEND 2/5] mfd: tps65090: add error prints when mem alloc failed
Date: Tue, 20 Nov 2012 08:44:46 +0530	[thread overview]
Message-ID: <1353381289-11643-3-git-send-email-ldewangan@nvidia.com> (raw)
In-Reply-To: <1353381289-11643-1-git-send-email-ldewangan@nvidia.com>

Add error prints when memory allocation failed for
tps65090 data. Also cleanups the melloc arguments.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
 drivers/mfd/tps65090.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/tps65090.c b/drivers/mfd/tps65090.c
index 9b79d68..f95f7f6 100644
--- a/drivers/mfd/tps65090.c
+++ b/drivers/mfd/tps65090.c
@@ -263,10 +263,11 @@ static int __devinit tps65090_i2c_probe(struct i2c_client *client,
 		return -EINVAL;
 	}
 
-	tps65090 = devm_kzalloc(&client->dev, sizeof(struct tps65090),
-		GFP_KERNEL);
-	if (tps65090 == NULL)
+	tps65090 = devm_kzalloc(&client->dev, sizeof(*tps65090), GFP_KERNEL);
+	if (!tps65090) {
+		dev_err(&client->dev, "mem alloc for tps65090 failed\n");
 		return -ENOMEM;
+	}
 
 	tps65090->client = client;
 	tps65090->dev = &client->dev;
-- 
1.7.1.1


  parent reply	other threads:[~2012-11-20  3:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-20  3:14 [PATCH RESEND 0/5] mfd: tps65090: cleanups and use regmap-irq for interrupt support Laxman Dewangan
2012-11-20  3:14 ` [PATCH RESEND 1/5] mfd: add battery charger in tps65090 sub devs Laxman Dewangan
2012-11-20  3:14 ` Laxman Dewangan [this message]
2012-11-20  3:14 ` [PATCH RESEND 3/5] mfd: tps65090: remove unused member of struct tps65090 Laxman Dewangan
2012-11-20  3:14 ` [PATCH RESEND 4/5] mfd: tps65090: move register access APIs to header Laxman Dewangan
2012-11-20  3:14 ` [PATCH RESEND 5/5] mfd: tps65090: use regmap irq framework for interrupt support Laxman Dewangan
2012-11-21 13:37 ` [PATCH RESEND 0/5] mfd: tps65090: cleanups and use regmap-irq " Samuel Ortiz

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=1353381289-11643-3-git-send-email-ldewangan@nvidia.com \
    --to=ldewangan@nvidia.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@linux.intel.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