From: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: Eric Nelson
<eric.nelson-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
der.herr-kA1LtwSENNE@public.gmane.org,
lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
bvijay-l0cyMroinI0@public.gmane.org,
pawel.moll-5wv7dgnIgG8@public.gmane.org,
mark.rutland-5wv7dgnIgG8@public.gmane.org,
ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org,
gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org,
gigi.joseph-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
eyalr-l0cyMroinI0@public.gmane.org,
robin-/Q/L1SwJa3aEVqv0pETR8A@public.gmane.org,
galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
eliad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org
Subject: Re: [PATCH 3/4] misc: ti-st: don't use NULL pdata
Date: Mon, 27 Apr 2015 11:52:43 +0300 [thread overview]
Message-ID: <20150427085242.GM16501@mwanda> (raw)
In-Reply-To: <1430000118-26386-3-git-send-email-eric.nelson-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
On Sat, Apr 25, 2015 at 03:15:17PM -0700, Eric Nelson wrote:
> Signed-off-by: Eric Nelson <eric.nelson-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
> ---
> drivers/misc/ti-st/st_kim.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c
> index c5a0e15..4b44345 100644
> --- a/drivers/misc/ti-st/st_kim.c
> +++ b/drivers/misc/ti-st/st_kim.c
> @@ -755,8 +755,10 @@ static struct ti_st_plat_data *get_platform_data(struct device *dev)
>
> dt_pdata = kzalloc(sizeof(*dt_pdata), GFP_KERNEL);
>
> - if (!dt_pdata)
> + if (!dt_pdata) {
> pr_err("Can't allocate device_tree platform data\n");
> + return 0;
return NULL;
Zero means success. You can delete the error message if you want.
That's just a waste of memory. 1) It's never going to be printed.
2) If this particular allocation failed then we would be able to tell
exactly what failed from the stack dump and from the message in the
caller function.
> + }
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-04-27 8:52 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-25 22:15 [PATCH 1/4] misc: ti-st: use GPIO_LOW for initial value of nshutdown Eric Nelson
[not found] ` <1430000118-26386-1-git-send-email-eric.nelson-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
2015-04-25 22:15 ` [PATCH 2/4] misc: ti-st: use of_get_named_gpio_flags for nshutdown Eric Nelson
[not found] ` <1430000118-26386-2-git-send-email-eric.nelson-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
2015-04-27 8:49 ` Dan Carpenter
2015-04-27 15:26 ` Eric Nelson
2015-04-25 22:15 ` [PATCH 3/4] misc: ti-st: don't use NULL pdata Eric Nelson
[not found] ` <1430000118-26386-3-git-send-email-eric.nelson-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
2015-04-27 8:52 ` Dan Carpenter [this message]
2015-04-27 19:19 ` Eric Nelson
2015-04-27 19:27 ` [PATCH V2 1/4] misc: ti-st: use GPIO_LOW for initial value of nshutdown Eric Nelson
[not found] ` <1430162849-8804-1-git-send-email-eric.nelson-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
2015-04-27 19:27 ` [PATCH V2 2/4] misc: ti-st: use of_get_named_gpio_flags for nshutdown Eric Nelson
[not found] ` <1430162849-8804-2-git-send-email-eric.nelson-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
2015-04-27 20:11 ` Peter Hurley
[not found] ` <553E97E8.4080103-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org>
2015-04-27 20:18 ` Eric Nelson
[not found] ` <553E99A7.1080206-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
2015-04-27 20:29 ` Peter Hurley
2015-04-27 19:27 ` [PATCH V2 3/4] misc: ti-st: don't use NULL pdata Eric Nelson
2015-04-27 19:27 ` [PATCH V2 4/4] Documentation: DT: misc: Add ti-st bindings Eric Nelson
2015-04-25 22:15 ` [PATCH " Eric Nelson
2015-04-28 11:17 ` [PATCH 1/4] misc: ti-st: use GPIO_LOW for initial value of nshutdown Lee Jones
2015-04-28 16:41 ` Eric Nelson
[not found] ` <553FB848.4090802-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
2015-04-28 17:56 ` Lee Jones
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=20150427085242.GM16501@mwanda \
--to=dan.carpenter-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
--cc=bvijay-l0cyMroinI0@public.gmane.org \
--cc=der.herr-kA1LtwSENNE@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=eliad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org \
--cc=eric.nelson-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org \
--cc=eyalr-l0cyMroinI0@public.gmane.org \
--cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=gigi.joseph-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
--cc=lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=robin-/Q/L1SwJa3aEVqv0pETR8A@public.gmane.org \
/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;
as well as URLs for NNTP newsgroup(s).