From: akpm@linux-foundation.org
To: g.liakhovetski@pengutronix.de, dbrownell@users.sourceforge.net,
mm-commits@vger.kernel.org
Subject: - gpio-gpio-driver-for-max7301-spi-gpio-expander-check-spi_setup-return-code-cleanup.patch removed from -mm tree
Date: Mon, 21 Jul 2008 14:19:36 -0700 [thread overview]
Message-ID: <200807212119.m6LLJas6025017@imap1.linux-foundation.org> (raw)
The patch titled
gpio max7301: check spi_setup() return code, cleanup
has been removed from the -mm tree. Its filename was
gpio-gpio-driver-for-max7301-spi-gpio-expander-check-spi_setup-return-code-cleanup.patch
This patch was dropped because it was folded into gpio-gpio-driver-for-max7301-spi-gpio-expander.patch
The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/
------------------------------------------------------
Subject: gpio max7301: check spi_setup() return code, cleanup
From: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de>
Fix inaccuracies in comments, check spi_setup() return code, mask off high
byte in max7301_read(). Thanks to David Brownell for the review.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/gpio/max7301.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff -puN drivers/gpio/max7301.c~gpio-gpio-driver-for-max7301-spi-gpio-expander-check-spi_setup-return-code-cleanup drivers/gpio/max7301.c
--- a/drivers/gpio/max7301.c~gpio-gpio-driver-for-max7301-spi-gpio-expander-check-spi_setup-return-code-cleanup
+++ a/drivers/gpio/max7301.c
@@ -71,7 +71,7 @@ struct max7301 {
*
* A write to the MAX7301 means one message with one transfer
*
- * Returns 0 if successfull or a negative value on error
+ * Returns 0 if successful or a negative value on error
*/
static int max7301_write(struct spi_device *spi, unsigned int reg, unsigned int val)
{
@@ -84,9 +84,9 @@ static int max7301_write(struct spi_devi
* @spi: The SPI device
* @reg: Register offset
*
- * A read from the MAX7301 means one message with two transfers
+ * A read from the MAX7301 means two transfers; here, one message each
*
- * Returns positive 8 bit value from device if successfull or a
+ * Returns positive 8 bit value from device if successful or a
* negative value on error
*/
static int max7301_read(struct spi_device *spi, unsigned int reg)
@@ -99,12 +99,13 @@ static int max7301_read(struct spi_devic
if (ret)
return ret;
/*
- * FIXME: This read should write 0x0000 (=NOOP at MAX7301 side)
+ * This relies on the fact, that a transfer with NULL tx_buf shifts out
+ * zero bytes (=NOOP for MAX7301)
*/
ret = spi_read(spi, (u8 *)&word, sizeof(word));
if (ret)
return ret;
- return word;
+ return word & 0xff;
}
static int max7301_direction_input(struct gpio_chip *chip, unsigned offset)
@@ -224,7 +225,9 @@ static int __devinit max7301_probe(struc
*/
spi->bits_per_word = 16;
- spi->master->setup(spi);
+ ret = spi_setup(spi);
+ if (ret < 0)
+ return ret;
ts = kzalloc(sizeof(struct max7301), GFP_KERNEL);
if (!ts)
_
Patches currently in -mm which might be from g.liakhovetski@pengutronix.de are
origin.patch
gpio-gpio-driver-for-max7301-spi-gpio-expander.patch
gpio-gpio-driver-for-max7301-spi-gpio-expander-check-spi_setup-return-code-cleanup.patch
linux-next.patch
git-arm.patch
git-dvb.patch
gpio-sysfs-interface-updated.patch
gpio-sysfs-interface-updated-update.patch
reply other threads:[~2008-07-21 21:20 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=200807212119.m6LLJas6025017@imap1.linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=dbrownell@users.sourceforge.net \
--cc=g.liakhovetski@pengutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mm-commits@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox