diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org.(none)> | 2005-04-19 10:31:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org.(none)> | 2005-04-19 10:31:40 -0400 |
commit | c79bea07ec4d3ef087962699fe8b2f6dc5ca7754 (patch) | |
tree | 3fbdc4745cfde60df7d05815b343e4a253020530 /drivers/w1/w1.c | |
parent | a9e4820c4c170b3df0d2185f7b4130b0b2daed2c (diff) | |
parent | 1d66c64c3cee10a465cd3f8bd9191bbeb718f650 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/i2c-2.6.git/
Diffstat (limited to 'drivers/w1/w1.c')
-rw-r--r-- | drivers/w1/w1.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index fd630cec0e79..8d7821899cc1 100644 --- a/drivers/w1/w1.c +++ b/drivers/w1/w1.c | |||
@@ -522,10 +522,11 @@ void w1_slave_found(unsigned long data, u64 rn) | |||
522 | slave_count++; | 522 | slave_count++; |
523 | } | 523 | } |
524 | 524 | ||
525 | if (slave_count == dev->slave_count && rn ) { | 525 | rn = cpu_to_le64(rn); |
526 | tmp = cpu_to_le64(rn); | 526 | |
527 | if(((rn >> 56) & 0xff) == w1_calc_crc8((u8 *)&tmp, 7)) | 527 | if (slave_count == dev->slave_count && |
528 | w1_attach_slave_device(dev, (struct w1_reg_num *) &rn); | 528 | rn && ((le64_to_cpu(rn) >> 56) & 0xff) == w1_calc_crc8((u8 *)&rn, 7)) { |
529 | w1_attach_slave_device(dev, tmp); | ||
529 | } | 530 | } |
530 | 531 | ||
531 | atomic_dec(&dev->refcnt); | 532 | atomic_dec(&dev->refcnt); |