From: Denis Kuzmenko <linux@solonet.org.ua>
To: Grant Likely <grant.likely@secretlab.ca>, linux-kernel@vger.kernel.org
Subject: [PATCH] gpio/gpio-sysfs: Try to export busy GPIO line leads to wrong GPIO line exporting
Date: Sun, 13 Nov 2011 03:30:57 +0200 [thread overview]
Message-ID: <4EBF1DD1.8090600@solonet.org.ua> (raw)
From: Denis Kuzmenko <linux@solonet.org.ua>
Fix bug in gpio-sysfs interface (export of busy GPIO line leads to export of different GPIO line).
Signed-off-by: Denis Kuzmenko <linux@solonet.org.ua>
---
Patch is against 3.0.9
When trying to export GPIO line 37(40) which is already exported/requested by kernel code we got GPIO line 3(4) exported.
Looks like this is done because `export_store` function doesn't return the number of processed bytes and gets a part of previous buffer again.
This fix works for me (Samsung s3c2440).
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index a971e3d..ccec497 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -633,7 +633,7 @@ static ssize_t export_store(struct class *class,
done:
if (status)
pr_debug("%s: status %d\n", __func__, status);
- return status ? : len;
+ return len;
}
static ssize_t unexport_store(struct class *class,
next reply other threads:[~2011-11-13 1:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-13 1:30 Denis Kuzmenko [this message]
2011-11-14 20:45 ` [PATCH] gpio/gpio-sysfs: Try to export busy GPIO line leads to wrong GPIO line exporting Stephen Warren
2011-11-14 23:14 ` Denis Kuzmenko
2011-11-15 20:23 ` Denis Kuzmenko
2011-11-15 21:14 ` Stephen Warren
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=4EBF1DD1.8090600@solonet.org.ua \
--to=linux@solonet.org.ua \
--cc=grant.likely@secretlab.ca \
--cc=linux-kernel@vger.kernel.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 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.