From: Axel Lin <axel.lin@ingics.com>
To: Samuel Ortiz <sameo@linux.intel.com>
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>, linux-kernel@vger.kernel.org
Subject: [PATCH RESEND] mfd: max8997: Return proper error if pdata is NULL
Date: Sat, 13 Apr 2013 21:56:45 +0800 [thread overview]
Message-ID: <1365861405.3814.1.camel@phoenix> (raw)
Return proper error instead of 0 if pdata is NULL.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/mfd/max8997.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/mfd/max8997.c b/drivers/mfd/max8997.c
index 1471405..823f34b 100644
--- a/drivers/mfd/max8997.c
+++ b/drivers/mfd/max8997.c
@@ -209,8 +209,10 @@ static int max8997_i2c_probe(struct i2c_client *i2c,
}
}
- if (!pdata)
+ if (!pdata) {
+ ret = -ENOMEM;
goto err;
+ }
max8997->pdata = pdata;
max8997->ono = pdata->ono;
--
1.7.9.5
reply other threads:[~2013-04-13 13:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1365861405.3814.1.camel@phoenix \
--to=axel.lin@ingics.com \
--cc=linux-kernel@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.