From: Ben Gardner <gardner.ben@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
Ben Gardner <gardner.ben@gmail.com>,
Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Subject: [patch] w1_ds2433: clear the validcrc flag after a write
Date: Sun, 22 Feb 2009 22:19:16 -0600 [thread overview]
Message-ID: <1235362756-10119-1-git-send-email-gardner.ben@gmail.com> (raw)
The w1_ds2433 driver does not read from the hardware if the CRC was valid on the last read.
The validcrc flag should be cleared after a write so that the new value can be read.
Signed-off-by: Ben Gardner <gardner.ben@gmail.com>
Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
--- linux-2.6.28.5.orig/drivers/w1/slaves/w1_ds2433.c 2009-02-16 13:52:06.000000000 -0600
+++ linux-2.6.28.5/drivers/w1/slaves/w1_ds2433.c 2009-02-16 13:52:27.000000000 -0600
@@ -156,6 +156,9 @@
*/
static int w1_f23_write(struct w1_slave *sl, int addr, int len, const u8 *data)
{
+#ifdef CONFIG_W1_SLAVE_DS2433_CRC
+ struct w1_f23_data *f23 = sl->family_data;
+#endif
u8 wrbuf[4];
u8 rdbuf[W1_PAGE_SIZE + 3];
u8 es = (addr + len - 1) & 0x1f;
@@ -196,7 +199,9 @@
/* Reset the bus to wake up the EEPROM (this may not be needed) */
w1_reset_bus(sl->master);
-
+#ifdef CONFIG_W1_SLAVE_DS2433_CRC
+ f23->validcrc &= ~(1 << (addr >> W1_PAGE_BITS));
+#endif
return 0;
}
reply other threads:[~2009-02-23 4:19 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=1235362756-10119-1-git-send-email-gardner.ben@gmail.com \
--to=gardner.ben@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=johnpol@2ka.mipt.ru \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox