aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/chips/it87.c2
-rw-r--r--drivers/i2c/chips/via686a.c5
-rw-r--r--drivers/w1/w1.c9
-rw-r--r--drivers/w1/w1_smem.c4
4 files changed, 10 insertions, 10 deletions
diff --git a/drivers/i2c/chips/it87.c b/drivers/i2c/chips/it87.c
index 3d484a7aff12..cf7e6898754f 100644
--- a/drivers/i2c/chips/it87.c
+++ b/drivers/i2c/chips/it87.c
@@ -668,7 +668,7 @@ static ssize_t show_alarms(struct device *dev, char *buf)
668 struct it87_data *data = it87_update_device(dev); 668 struct it87_data *data = it87_update_device(dev);
669 return sprintf(buf,"%d\n", ALARMS_FROM_REG(data->alarms)); 669 return sprintf(buf,"%d\n", ALARMS_FROM_REG(data->alarms));
670} 670}
671static DEVICE_ATTR(alarms, S_IRUGO | S_IWUSR, show_alarms, NULL); 671static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
672 672
673static ssize_t 673static ssize_t
674show_vrm_reg(struct device *dev, char *buf) 674show_vrm_reg(struct device *dev, char *buf)
diff --git a/drivers/i2c/chips/via686a.c b/drivers/i2c/chips/via686a.c
index 9b948f4531f5..6614a59cecd4 100644
--- a/drivers/i2c/chips/via686a.c
+++ b/drivers/i2c/chips/via686a.c
@@ -574,7 +574,7 @@ static ssize_t show_alarms(struct device *dev, char *buf) {
574 struct via686a_data *data = via686a_update_device(dev); 574 struct via686a_data *data = via686a_update_device(dev);
575 return sprintf(buf,"%d\n", ALARMS_FROM_REG(data->alarms)); 575 return sprintf(buf,"%d\n", ALARMS_FROM_REG(data->alarms));
576} 576}
577static DEVICE_ATTR(alarms, S_IRUGO | S_IWUSR, show_alarms, NULL); 577static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
578 578
579/* The driver. I choose to use type i2c_driver, as at is identical to both 579/* The driver. I choose to use type i2c_driver, as at is identical to both
580 smbus_driver and isa_driver, and clients could be of either kind */ 580 smbus_driver and isa_driver, and clients could be of either kind */
@@ -651,10 +651,9 @@ static int via686a_detect(struct i2c_adapter *adapter, int address, int kind)
651 new_client->adapter = adapter; 651 new_client->adapter = adapter;
652 new_client->driver = &via686a_driver; 652 new_client->driver = &via686a_driver;
653 new_client->flags = 0; 653 new_client->flags = 0;
654 new_client->dev.parent = &adapter->dev;
655 654
656 /* Fill in the remaining client fields and put into the global list */ 655 /* Fill in the remaining client fields and put into the global list */
657 snprintf(new_client->name, I2C_NAME_SIZE, client_name); 656 strlcpy(new_client->name, client_name, I2C_NAME_SIZE);
658 657
659 data->valid = 0; 658 data->valid = 0;
660 init_MUTEX(&data->update_lock); 659 init_MUTEX(&data->update_lock);
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);
diff --git a/drivers/w1/w1_smem.c b/drivers/w1/w1_smem.c
index ab82eb7ed74f..a54e425217a0 100644
--- a/drivers/w1/w1_smem.c
+++ b/drivers/w1/w1_smem.c
@@ -60,7 +60,7 @@ static ssize_t w1_smem_read_val(struct device *dev, char *buf)
60 int i; 60 int i;
61 ssize_t count = 0; 61 ssize_t count = 0;
62 62
63 for (i = 0; i < 9; ++i) 63 for (i = 0; i < 8; ++i)
64 count += sprintf(buf + count, "%02x ", ((u8 *)&sl->reg_num)[i]); 64 count += sprintf(buf + count, "%02x ", ((u8 *)&sl->reg_num)[i]);
65 count += sprintf(buf + count, "\n"); 65 count += sprintf(buf + count, "\n");
66 66
@@ -87,7 +87,7 @@ static ssize_t w1_smem_read_bin(struct kobject *kobj, char *buf, loff_t off, siz
87 count = 0; 87 count = 0;
88 goto out; 88 goto out;
89 } 89 }
90 for (i = 0; i < 9; ++i) 90 for (i = 0; i < 8; ++i)
91 count += sprintf(buf + count, "%02x ", ((u8 *)&sl->reg_num)[i]); 91 count += sprintf(buf + count, "%02x ", ((u8 *)&sl->reg_num)[i]);
92 count += sprintf(buf + count, "\n"); 92 count += sprintf(buf + count, "\n");
93 93