linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gregory Bean <gbean@codeaurora.org>
To: akpm@linux-foundation.org
Cc: linux-arm-msm@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	"Gregory Bean" <gbean@codeaurora.org>,
	"Jani Nikula" <ext-jani.1.nikula@nokia.com>,
	"David Brownell" <dbrownell@users.sourceforge.net>,
	"Greg Kroah-Hartman" <gregkh@suse.de>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Subject: [PATCH] gpio: remove spurious gpio_unexport debug error.
Date: Thu, 22 Jul 2010 14:05:58 -0700	[thread overview]
Message-ID: <1279832758-25442-1-git-send-email-gbean@codeaurora.org> (raw)

Make gpio_unexport generate success instead of an -EINVAL
if asked to unexport a line which is not exported, because
the only result of that condition is a pr_debug
which complains of what is really a harmless no-op:
when an unexported gpio is unexported again, nothing happens.
That's not a failure, just a trivial border case.
Since gpio_free calls gpio_unexport unconditionally
and exported gpio lines are uncommon, most calls to
gpio_free with debug flags enabled generate -EINVAL
warnings in the log, causing unnecessary stress.

Signed-off-by: Gregory Bean <gbean@codeaurora.org>
---
 drivers/gpio/gpiolib.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 3ca3654..b718aea 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -914,7 +914,8 @@ void gpio_unexport(unsigned gpio)
 			status = 0;
 		} else
 			status = -ENODEV;
-	}
+	} else
+		status = 0;
 
 	mutex_unlock(&sysfs_lock);
 done:
-- 
1.7.0.4

--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

             reply	other threads:[~2010-07-22 21:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-22 21:05 Gregory Bean [this message]
2010-07-23  4:58 ` [PATCH] gpio: remove spurious gpio_unexport debug error Uwe Kleine-König
2010-07-26 22:32   ` Andrew Morton
2010-07-27 15:32     ` Uwe Kleine-König

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=1279832758-25442-1-git-send-email-gbean@codeaurora.org \
    --to=gbean@codeaurora.org \
    --cc=akpm@linux-foundation.org \
    --cc=dbrownell@users.sourceforge.net \
    --cc=ext-jani.1.nikula@nokia.com \
    --cc=gregkh@suse.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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).