From: Stephen Boyd <sboyd@codeaurora.org>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@ti.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] regulator: Clean up debugfs error handling a bit
Date: Mon, 20 Feb 2012 22:41:30 -0800 [thread overview]
Message-ID: <4F433C9A.5080503@codeaurora.org> (raw)
In-Reply-To: <1329772500-20577-1-git-send-email-broonie@opensource.wolfsonmicro.com>
On 2/20/2012 1:15 PM, Mark Brown wrote:
> Use IS_ERR_OR_NULL() rather than open coding it and ignore errors from
> failure to create the supply map.
Reported-by: Stephen Boyd <sboyd@codeaurora.org>
>
> Signed-off-by: Mark Brown<broonie@opensource.wolfsonmicro.com>
>
> @@ -3231,14 +3231,13 @@ static int __init regulator_init(void)
>
> #ifdef CONFIG_DEBUG_FS
> debugfs_root = debugfs_create_dir("regulator", NULL);
> - if (IS_ERR(debugfs_root) || !debugfs_root) {
> + if (IS_ERR_OR_NULL(debugfs_root)) {
> pr_warn("regulator: Failed to create debugfs directory\n");
> debugfs_root = NULL;
> }
>
> - if (IS_ERR(debugfs_create_file("supply_map", 0444, debugfs_root,
> - NULL,&supply_map_fops)))
> - pr_warn("regulator: Failed to create supplies debugfs\n");
> + debugfs_create_file("supply_map", 0444, debugfs_root, NULL,
> + &supply_map_fops);
Do you want an else here so that if the regulator directory fails we
don't accidentally create a supply_map file in the root of debugfs? How
ever unlikely that sounds.
next prev parent reply other threads:[~2012-02-21 6:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-20 21:15 [PATCH] regulator: Clean up debugfs error handling a bit Mark Brown
2012-02-21 6:41 ` Stephen Boyd [this message]
[not found] <Message-Id: <1329772500-20577-1-git-send-email-broonie@opensource.wolfsonmicro.com>
2012-02-21 6:50 ` [PATCH] regulator: Simplify debugfs code Stephen Boyd
2012-02-21 9:40 ` 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=4F433C9A.5080503@codeaurora.org \
--to=sboyd@codeaurora.org \
--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