[PATCH] w1: real fix for big endian machines.

Real fix for big endian machines - crc must be calculated
using little endian byte order.

Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


authored by johnpol@2ka.mipt.ru and committed by Greg KH 8523ff45 c0698f2f

+5 -4
+5 -4
drivers/w1/w1.c
··· 522 slave_count++; 523 } 524 525 - if (slave_count == dev->slave_count && rn ) { 526 - tmp = cpu_to_le64(rn); 527 - if(((rn >> 56) & 0xff) == w1_calc_crc8((u8 *)&tmp, 7)) 528 - w1_attach_slave_device(dev, (struct w1_reg_num *) &rn); 529 } 530 531 atomic_dec(&dev->refcnt);
··· 522 slave_count++; 523 } 524 525 + rn = cpu_to_le64(rn); 526 + 527 + if (slave_count == dev->slave_count && 528 + rn && ((le64_to_cpu(rn) >> 56) & 0xff) == w1_calc_crc8((u8 *)&rn, 7)) { 529 + w1_attach_slave_device(dev, tmp); 530 } 531 532 atomic_dec(&dev->refcnt);