Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hwmon: (lm85) Coding-style cleanups

Fix most style issues reported by checkpatch, including:
* Trailing, missing and extra whitespace
* Extra parentheses, curly braces and semi-colons
* Broken indentation
* Lines too long

I verified that the generated code is the same before and after
these changes.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Juerg Haefliger <juergh at gmail.com>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>

authored by

Jean Delvare and committed by
Mark M. Hoffman
1f44809a 9ebd3d82

+254 -249
+254 -249
drivers/hwmon/lm85.c
··· 1 1 /* 2 2 lm85.c - Part of lm_sensors, Linux kernel modules for hardware 3 3 monitoring 4 - Copyright (c) 1998, 1999 Frodo Looijaard <frodol@dds.nl> 4 + Copyright (c) 1998, 1999 Frodo Looijaard <frodol@dds.nl> 5 5 Copyright (c) 2002, 2003 Philip Pokorny <ppokorny@penguincomputing.com> 6 6 Copyright (c) 2003 Margit Schubert-While <margitsw@t-online.de> 7 7 Copyright (c) 2004 Justin Thiessen <jthiessen@penguincomputing.com> ··· 51 51 #define LM85_REG_TEMP_MAX(nr) (0x4f + (nr) * 2) 52 52 53 53 /* Fan speeds are LSB, MSB (2 bytes) */ 54 - #define LM85_REG_FAN(nr) (0x28 + (nr) *2) 55 - #define LM85_REG_FAN_MIN(nr) (0x54 + (nr) *2) 54 + #define LM85_REG_FAN(nr) (0x28 + (nr) * 2) 55 + #define LM85_REG_FAN_MIN(nr) (0x54 + (nr) * 2) 56 56 57 57 #define LM85_REG_PWM(nr) (0x30 + (nr)) 58 58 ··· 68 68 #define LM85_DEVICE_ADX 0x27 69 69 #define LM85_COMPANY_NATIONAL 0x01 70 70 #define LM85_COMPANY_ANALOG_DEV 0x41 71 - #define LM85_COMPANY_SMSC 0x5c 71 + #define LM85_COMPANY_SMSC 0x5c 72 72 #define LM85_VERSTEP_VMASK 0xf0 73 73 #define LM85_VERSTEP_GENERIC 0x60 74 74 #define LM85_VERSTEP_LM85C 0x60 ··· 115 115 116 116 #define EMC6D100_REG_ALARM3 0x7d 117 117 /* IN5, IN6 and IN7 */ 118 - #define EMC6D100_REG_IN(nr) (0x70 + ((nr)-5)) 119 - #define EMC6D100_REG_IN_MIN(nr) (0x73 + ((nr)-5) * 2) 120 - #define EMC6D100_REG_IN_MAX(nr) (0x74 + ((nr)-5) * 2) 118 + #define EMC6D100_REG_IN(nr) (0x70 + ((nr) - 5)) 119 + #define EMC6D100_REG_IN_MIN(nr) (0x73 + ((nr) - 5) * 2) 120 + #define EMC6D100_REG_IN_MAX(nr) (0x74 + ((nr) - 5) * 2) 121 121 #define EMC6D102_REG_EXTEND_ADC1 0x85 122 122 #define EMC6D102_REG_EXTEND_ADC2 0x86 123 123 #define EMC6D102_REG_EXTEND_ADC3 0x87 124 124 #define EMC6D102_REG_EXTEND_ADC4 0x88 125 125 126 126 127 - /* Conversions. Rounding and limit checking is only done on the TO_REG 127 + /* Conversions. Rounding and limit checking is only done on the TO_REG 128 128 variants. Note that you should be a bit careful with which arguments 129 129 these macros are called: arguments may be evaluated more than once. 130 130 */ 131 131 132 132 /* IN are scaled acording to built-in resistors */ 133 133 static int lm85_scaling[] = { /* .001 Volts */ 134 - 2500, 2250, 3300, 5000, 12000, 135 - 3300, 1500, 1800 /*EMC6D100*/ 136 - }; 137 - #define SCALE(val,from,to) (((val)*(to) + ((from)/2))/(from)) 134 + 2500, 2250, 3300, 5000, 12000, 135 + 3300, 1500, 1800 /*EMC6D100*/ 136 + }; 137 + #define SCALE(val, from, to) (((val) * (to) + ((from) / 2)) / (from)) 138 138 139 - #define INS_TO_REG(n,val) \ 140 - SENSORS_LIMIT(SCALE(val,lm85_scaling[n],192),0,255) 139 + #define INS_TO_REG(n, val) \ 140 + SENSORS_LIMIT(SCALE(val, lm85_scaling[n], 192), 0, 255) 141 141 142 - #define INSEXT_FROM_REG(n,val,ext) \ 142 + #define INSEXT_FROM_REG(n, val, ext) \ 143 143 SCALE(((val) << 4) + (ext), 192 << 4, lm85_scaling[n]) 144 144 145 - #define INS_FROM_REG(n,val) SCALE((val), 192, lm85_scaling[n]) 145 + #define INS_FROM_REG(n, val) SCALE((val), 192, lm85_scaling[n]) 146 146 147 147 /* FAN speed is measured using 90kHz clock */ 148 148 static inline u16 FAN_TO_REG(unsigned long val) ··· 151 151 return 0xffff; 152 152 return SENSORS_LIMIT(5400000 / val, 1, 0xfffe); 153 153 } 154 - #define FAN_FROM_REG(val) ((val)==0?-1:(val)==0xffff?0:5400000/(val)) 154 + #define FAN_FROM_REG(val) ((val) == 0 ? -1 : (val) == 0xffff ? 0 : \ 155 + 5400000 / (val)) 155 156 156 157 /* Temperature is reported in .001 degC increments */ 157 158 #define TEMP_TO_REG(val) \ 158 - SENSORS_LIMIT(SCALE(val,1000,1),-127,127) 159 - #define TEMPEXT_FROM_REG(val,ext) \ 159 + SENSORS_LIMIT(SCALE(val, 1000, 1), -127, 127) 160 + #define TEMPEXT_FROM_REG(val, ext) \ 160 161 SCALE(((val) << 4) + (ext), 16, 1000) 161 162 #define TEMP_FROM_REG(val) ((val) * 1000) 162 163 163 - #define PWM_TO_REG(val) (SENSORS_LIMIT(val,0,255)) 164 + #define PWM_TO_REG(val) SENSORS_LIMIT(val, 0, 255) 164 165 #define PWM_FROM_REG(val) (val) 165 166 166 167 ··· 184 183 */ 185 184 186 185 /* These are the zone temperature range encodings in .001 degree C */ 187 - static int lm85_range_map[] = { 188 - 2000, 2500, 3300, 4000, 5000, 6600, 189 - 8000, 10000, 13300, 16000, 20000, 26600, 190 - 32000, 40000, 53300, 80000 191 - }; 192 - static int RANGE_TO_REG( int range ) 186 + static int lm85_range_map[] = { 187 + 2000, 2500, 3300, 4000, 5000, 6600, 8000, 10000, 188 + 13300, 16000, 20000, 26600, 32000, 40000, 53300, 80000 189 + }; 190 + 191 + static int RANGE_TO_REG(int range) 193 192 { 194 193 int i; 195 194 196 195 if (range >= lm85_range_map[15]) 197 - return 15 ; 196 + return 15; 198 197 199 198 /* Find the closest match */ 200 199 for (i = 14; i >= 0; --i) { ··· 208 207 209 208 return 0; 210 209 } 211 - #define RANGE_FROM_REG(val) (lm85_range_map[(val)&0x0f]) 210 + #define RANGE_FROM_REG(val) lm85_range_map[(val) & 0x0f] 212 211 213 212 /* These are the Acoustic Enhancement, or Temperature smoothing encodings 214 213 * NOTE: The enable/disable bit is INCLUDED in these encodings as the ··· 217 216 */ 218 217 /* These are the PWM frequency encodings */ 219 218 static int lm85_freq_map[] = { /* .1 Hz */ 220 - 100, 150, 230, 300, 380, 470, 620, 940 221 - }; 222 - static int FREQ_TO_REG( int freq ) 219 + 100, 150, 230, 300, 380, 470, 620, 940 220 + }; 221 + 222 + static int FREQ_TO_REG(int freq) 223 223 { 224 224 int i; 225 225 226 - if( freq >= lm85_freq_map[7] ) { return 7 ; } 227 - for( i = 0 ; i < 7 ; ++i ) 228 - if( freq <= lm85_freq_map[i] ) 229 - break ; 230 - return( i & 0x07 ); 226 + if (freq >= lm85_freq_map[7]) 227 + return 7; 228 + for (i = 0; i < 7; ++i) 229 + if (freq <= lm85_freq_map[i]) 230 + break; 231 + return i & 0x07; 231 232 } 232 - #define FREQ_FROM_REG(val) (lm85_freq_map[(val)&0x07]) 233 + #define FREQ_FROM_REG(val) lm85_freq_map[(val) & 0x07] 233 234 234 235 /* Since we can't use strings, I'm abusing these numbers 235 236 * to stand in for the following meanings: ··· 246 243 */ 247 244 248 245 static int lm85_zone_map[] = { 1, 2, 3, -1, 0, 23, 123, -2 }; 249 - #define ZONE_FROM_REG(val) (lm85_zone_map[((val)>>5)&0x07]) 246 + #define ZONE_FROM_REG(val) lm85_zone_map[((val) >> 5) & 0x07] 250 247 251 - static int ZONE_TO_REG( int zone ) 248 + static int ZONE_TO_REG(int zone) 252 249 { 253 250 int i; 254 251 255 - for( i = 0 ; i <= 7 ; ++i ) 256 - if( zone == lm85_zone_map[i] ) 257 - break ; 258 - if( i > 7 ) /* Not found. */ 252 + for (i = 0; i <= 7; ++i) 253 + if (zone == lm85_zone_map[i]) 254 + break; 255 + if (i > 7) /* Not found. */ 259 256 i = 3; /* Always 100% */ 260 - return( (i & 0x07)<<5 ); 257 + return (i & 0x07) << 5; 261 258 } 262 259 263 - #define HYST_TO_REG(val) (SENSORS_LIMIT(((val)+500)/1000,0,15)) 264 - #define HYST_FROM_REG(val) ((val)*1000) 260 + #define HYST_TO_REG(val) SENSORS_LIMIT(((val) + 500) / 1000, 0, 15) 261 + #define HYST_FROM_REG(val) ((val) * 1000) 265 262 266 - #define OFFSET_TO_REG(val) (SENSORS_LIMIT((val)/25,-127,127)) 267 - #define OFFSET_FROM_REG(val) ((val)*25) 263 + #define OFFSET_TO_REG(val) SENSORS_LIMIT((val) / 25, -127, 127) 264 + #define OFFSET_FROM_REG(val) ((val) * 25) 268 265 269 - #define PPR_MASK(fan) (0x03<<(fan *2)) 270 - #define PPR_TO_REG(val,fan) (SENSORS_LIMIT((val)-1,0,3)<<(fan *2)) 271 - #define PPR_FROM_REG(val,fan) ((((val)>>(fan * 2))&0x03)+1) 266 + #define PPR_MASK(fan) (0x03 << ((fan) * 2)) 267 + #define PPR_TO_REG(val, fan) (SENSORS_LIMIT((val) - 1, 0, 3) << ((fan) * 2)) 268 + #define PPR_FROM_REG(val, fan) ((((val) >> ((fan) * 2)) & 0x03) + 1) 272 269 273 270 /* Chip sampling rates 274 271 * ··· 295 292 u8 hyst; /* Low limit hysteresis. (0-15) */ 296 293 u8 range; /* Temp range, encoded */ 297 294 s8 critical; /* "All fans ON" temp limit */ 298 - u8 off_desired; /* Actual "off" temperature specified. Preserved 295 + u8 off_desired; /* Actual "off" temperature specified. Preserved 299 296 * to prevent "drift" as other autofan control 300 297 * values change. 301 298 */ 302 - u8 max_desired; /* Actual "max" temperature specified. Preserved 299 + u8 max_desired; /* Actual "max" temperature specified. Preserved 303 300 * to prevent "drift" as other autofan control 304 301 * values change. 305 302 */ ··· 378 375 { 379 376 int nr = to_sensor_dev_attr(attr)->index; 380 377 struct lm85_data *data = lm85_update_device(dev); 381 - return sprintf(buf,"%d\n", FAN_FROM_REG(data->fan[nr]) ); 378 + return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan[nr])); 382 379 } 383 380 384 381 static ssize_t show_fan_min(struct device *dev, struct device_attribute *attr, ··· 386 383 { 387 384 int nr = to_sensor_dev_attr(attr)->index; 388 385 struct lm85_data *data = lm85_update_device(dev); 389 - return sprintf(buf,"%d\n", FAN_FROM_REG(data->fan_min[nr]) ); 386 + return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan_min[nr])); 390 387 } 391 388 392 389 static ssize_t set_fan_min(struct device *dev, struct device_attribute *attr, ··· 417 414 418 415 /* vid, vrm, alarms */ 419 416 420 - static ssize_t show_vid_reg(struct device *dev, struct device_attribute *attr, char *buf) 417 + static ssize_t show_vid_reg(struct device *dev, struct device_attribute *attr, 418 + char *buf) 421 419 { 422 420 struct lm85_data *data = lm85_update_device(dev); 423 421 int vid; ··· 436 432 437 433 static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid_reg, NULL); 438 434 439 - static ssize_t show_vrm_reg(struct device *dev, struct device_attribute *attr, char *buf) 435 + static ssize_t show_vrm_reg(struct device *dev, struct device_attribute *attr, 436 + char *buf) 440 437 { 441 438 struct lm85_data *data = dev_get_drvdata(dev); 442 439 return sprintf(buf, "%ld\n", (long) data->vrm); 443 440 } 444 441 445 - static ssize_t store_vrm_reg(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) 442 + static ssize_t store_vrm_reg(struct device *dev, struct device_attribute *attr, 443 + const char *buf, size_t count) 446 444 { 447 445 struct lm85_data *data = dev_get_drvdata(dev); 448 446 data->vrm = simple_strtoul(buf, NULL, 10); ··· 453 447 454 448 static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg); 455 449 456 - static ssize_t show_alarms_reg(struct device *dev, struct device_attribute *attr, char *buf) 450 + static ssize_t show_alarms_reg(struct device *dev, struct device_attribute 451 + *attr, char *buf) 457 452 { 458 453 struct lm85_data *data = lm85_update_device(dev); 459 454 return sprintf(buf, "%u\n", data->alarms); ··· 495 488 { 496 489 int nr = to_sensor_dev_attr(attr)->index; 497 490 struct lm85_data *data = lm85_update_device(dev); 498 - return sprintf(buf,"%d\n", PWM_FROM_REG(data->pwm[nr]) ); 491 + return sprintf(buf, "%d\n", PWM_FROM_REG(data->pwm[nr])); 499 492 } 500 493 501 494 static ssize_t set_pwm(struct device *dev, struct device_attribute *attr, ··· 588 581 { 589 582 int nr = to_sensor_dev_attr(attr)->index; 590 583 struct lm85_data *data = lm85_update_device(dev); 591 - return sprintf( buf, "%d\n", INSEXT_FROM_REG(nr, 592 - data->in[nr], 593 - data->in_ext[nr])); 584 + return sprintf(buf, "%d\n", INSEXT_FROM_REG(nr, data->in[nr], 585 + data->in_ext[nr])); 594 586 } 595 587 596 - static ssize_t show_in_min(struct device *dev, struct device_attribute *attr, 588 + static ssize_t show_in_min(struct device *dev, struct device_attribute *attr, 597 589 char *buf) 598 590 { 599 591 int nr = to_sensor_dev_attr(attr)->index; 600 592 struct lm85_data *data = lm85_update_device(dev); 601 - return sprintf(buf,"%d\n", INS_FROM_REG(nr, data->in_min[nr]) ); 593 + return sprintf(buf, "%d\n", INS_FROM_REG(nr, data->in_min[nr])); 602 594 } 603 595 604 596 static ssize_t set_in_min(struct device *dev, struct device_attribute *attr, ··· 620 614 { 621 615 int nr = to_sensor_dev_attr(attr)->index; 622 616 struct lm85_data *data = lm85_update_device(dev); 623 - return sprintf(buf,"%d\n", INS_FROM_REG(nr, data->in_max[nr]) ); 617 + return sprintf(buf, "%d\n", INS_FROM_REG(nr, data->in_max[nr])); 624 618 } 625 619 626 620 static ssize_t set_in_max(struct device *dev, struct device_attribute *attr, ··· 662 656 { 663 657 int nr = to_sensor_dev_attr(attr)->index; 664 658 struct lm85_data *data = lm85_update_device(dev); 665 - return sprintf(buf,"%d\n", TEMPEXT_FROM_REG(data->temp[nr], 666 - data->temp_ext[nr])); 659 + return sprintf(buf, "%d\n", TEMPEXT_FROM_REG(data->temp[nr], 660 + data->temp_ext[nr])); 667 661 } 668 662 669 663 static ssize_t show_temp_min(struct device *dev, struct device_attribute *attr, ··· 671 665 { 672 666 int nr = to_sensor_dev_attr(attr)->index; 673 667 struct lm85_data *data = lm85_update_device(dev); 674 - return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_min[nr]) ); 668 + return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_min[nr])); 675 669 } 676 670 677 671 static ssize_t set_temp_min(struct device *dev, struct device_attribute *attr, ··· 694 688 { 695 689 int nr = to_sensor_dev_attr(attr)->index; 696 690 struct lm85_data *data = lm85_update_device(dev); 697 - return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_max[nr]) ); 691 + return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max[nr])); 698 692 } 699 693 700 694 static ssize_t set_temp_max(struct device *dev, struct device_attribute *attr, ··· 703 697 int nr = to_sensor_dev_attr(attr)->index; 704 698 struct i2c_client *client = to_i2c_client(dev); 705 699 struct lm85_data *data = i2c_get_clientdata(client); 706 - long val = simple_strtol(buf, NULL, 10); 700 + long val = simple_strtol(buf, NULL, 10); 707 701 708 702 mutex_lock(&data->update_lock); 709 703 data->temp_max[nr] = TEMP_TO_REG(val); ··· 732 726 { 733 727 int nr = to_sensor_dev_attr(attr)->index; 734 728 struct lm85_data *data = lm85_update_device(dev); 735 - return sprintf(buf,"%d\n", ZONE_FROM_REG(data->autofan[nr].config)); 729 + return sprintf(buf, "%d\n", ZONE_FROM_REG(data->autofan[nr].config)); 736 730 } 737 731 738 732 static ssize_t set_pwm_auto_channels(struct device *dev, ··· 741 735 int nr = to_sensor_dev_attr(attr)->index; 742 736 struct i2c_client *client = to_i2c_client(dev); 743 737 struct lm85_data *data = i2c_get_clientdata(client); 744 - long val = simple_strtol(buf, NULL, 10); 738 + long val = simple_strtol(buf, NULL, 10); 745 739 746 740 mutex_lock(&data->update_lock); 747 741 data->autofan[nr].config = (data->autofan[nr].config & (~0xe0)) 748 - | ZONE_TO_REG(val) ; 742 + | ZONE_TO_REG(val); 749 743 lm85_write_value(client, LM85_REG_AFAN_CONFIG(nr), 750 744 data->autofan[nr].config); 751 745 mutex_unlock(&data->update_lock); ··· 757 751 { 758 752 int nr = to_sensor_dev_attr(attr)->index; 759 753 struct lm85_data *data = lm85_update_device(dev); 760 - return sprintf(buf,"%d\n", PWM_FROM_REG(data->autofan[nr].min_pwm)); 754 + return sprintf(buf, "%d\n", PWM_FROM_REG(data->autofan[nr].min_pwm)); 761 755 } 762 756 763 757 static ssize_t set_pwm_auto_pwm_min(struct device *dev, ··· 781 775 { 782 776 int nr = to_sensor_dev_attr(attr)->index; 783 777 struct lm85_data *data = lm85_update_device(dev); 784 - return sprintf(buf,"%d\n", data->autofan[nr].min_off); 778 + return sprintf(buf, "%d\n", data->autofan[nr].min_off); 785 779 } 786 780 787 781 static ssize_t set_pwm_auto_pwm_minctl(struct device *dev, ··· 798 792 | data->syncpwm3 799 793 | (data->autofan[0].min_off ? 0x20 : 0) 800 794 | (data->autofan[1].min_off ? 0x40 : 0) 801 - | (data->autofan[2].min_off ? 0x80 : 0) 802 - ); 795 + | (data->autofan[2].min_off ? 0x80 : 0)); 803 796 mutex_unlock(&data->update_lock); 804 797 return count; 805 798 } ··· 808 803 { 809 804 int nr = to_sensor_dev_attr(attr)->index; 810 805 struct lm85_data *data = lm85_update_device(dev); 811 - return sprintf(buf,"%d\n", FREQ_FROM_REG(data->autofan[nr].freq)); 806 + return sprintf(buf, "%d\n", FREQ_FROM_REG(data->autofan[nr].freq)); 812 807 } 813 808 814 809 static ssize_t set_pwm_auto_pwm_freq(struct device *dev, ··· 823 818 data->autofan[nr].freq = FREQ_TO_REG(val); 824 819 lm85_write_value(client, LM85_REG_AFAN_RANGE(nr), 825 820 (data->zone[nr].range << 4) 826 - | data->autofan[nr].freq 827 - ); 821 + | data->autofan[nr].freq); 828 822 mutex_unlock(&data->update_lock); 829 823 return count; 830 824 } ··· 853 849 { 854 850 int nr = to_sensor_dev_attr(attr)->index; 855 851 struct lm85_data *data = lm85_update_device(dev); 856 - return sprintf(buf,"%d\n", TEMP_FROM_REG(data->zone[nr].limit) - 852 + return sprintf(buf, "%d\n", TEMP_FROM_REG(data->zone[nr].limit) - 857 853 HYST_FROM_REG(data->zone[nr].hyst)); 858 854 } 859 855 ··· 870 866 min = TEMP_FROM_REG(data->zone[nr].limit); 871 867 data->zone[nr].off_desired = TEMP_TO_REG(val); 872 868 data->zone[nr].hyst = HYST_TO_REG(min - val); 873 - if ( nr == 0 || nr == 1 ) { 869 + if (nr == 0 || nr == 1) { 874 870 lm85_write_value(client, LM85_REG_AFAN_HYST1, 875 871 (data->zone[0].hyst << 4) 876 - | data->zone[1].hyst 877 - ); 872 + | data->zone[1].hyst); 878 873 } else { 879 874 lm85_write_value(client, LM85_REG_AFAN_HYST2, 880 - (data->zone[2].hyst << 4) 881 - ); 875 + (data->zone[2].hyst << 4)); 882 876 } 883 877 mutex_unlock(&data->update_lock); 884 878 return count; ··· 887 885 { 888 886 int nr = to_sensor_dev_attr(attr)->index; 889 887 struct lm85_data *data = lm85_update_device(dev); 890 - return sprintf(buf,"%d\n", TEMP_FROM_REG(data->zone[nr].limit) ); 888 + return sprintf(buf, "%d\n", TEMP_FROM_REG(data->zone[nr].limit)); 891 889 } 892 890 893 891 static ssize_t set_temp_auto_temp_min(struct device *dev, ··· 915 913 data->zone[nr].hyst = HYST_TO_REG(TEMP_FROM_REG( 916 914 data->zone[nr].limit) - TEMP_FROM_REG( 917 915 data->zone[nr].off_desired)); 918 - if ( nr == 0 || nr == 1 ) { 916 + if (nr == 0 || nr == 1) { 919 917 lm85_write_value(client, LM85_REG_AFAN_HYST1, 920 918 (data->zone[0].hyst << 4) 921 - | data->zone[1].hyst 922 - ); 919 + | data->zone[1].hyst); 923 920 } else { 924 921 lm85_write_value(client, LM85_REG_AFAN_HYST2, 925 - (data->zone[2].hyst << 4) 926 - ); 922 + (data->zone[2].hyst << 4)); 927 923 } 928 924 mutex_unlock(&data->update_lock); 929 925 return count; ··· 932 932 { 933 933 int nr = to_sensor_dev_attr(attr)->index; 934 934 struct lm85_data *data = lm85_update_device(dev); 935 - return sprintf(buf,"%d\n", TEMP_FROM_REG(data->zone[nr].limit) + 935 + return sprintf(buf, "%d\n", TEMP_FROM_REG(data->zone[nr].limit) + 936 936 RANGE_FROM_REG(data->zone[nr].range)); 937 937 } 938 938 ··· 962 962 { 963 963 int nr = to_sensor_dev_attr(attr)->index; 964 964 struct lm85_data *data = lm85_update_device(dev); 965 - return sprintf(buf,"%d\n", TEMP_FROM_REG(data->zone[nr].critical)); 965 + return sprintf(buf, "%d\n", TEMP_FROM_REG(data->zone[nr].critical)); 966 966 } 967 967 968 968 static ssize_t set_temp_auto_temp_crit(struct device *dev, 969 - struct device_attribute *attr,const char *buf, size_t count) 969 + struct device_attribute *attr, const char *buf, size_t count) 970 970 { 971 971 int nr = to_sensor_dev_attr(attr)->index; 972 972 struct i2c_client *client = to_i2c_client(dev); ··· 1130 1130 static int lm85_detect(struct i2c_adapter *adapter, int address, 1131 1131 int kind) 1132 1132 { 1133 - int company, verstep ; 1133 + int company, verstep; 1134 1134 struct i2c_client *new_client = NULL; 1135 1135 struct lm85_data *data; 1136 1136 int err = 0; ··· 1139 1139 if (!i2c_check_functionality(adapter, 1140 1140 I2C_FUNC_SMBUS_BYTE_DATA)) { 1141 1141 /* We need to be able to do byte I/O */ 1142 - goto ERROR0 ; 1143 - }; 1142 + goto ERROR0; 1143 + } 1144 1144 1145 1145 /* OK. For now, we presume we have a valid client. We now create the 1146 1146 client structure, even though we cannot fill it completely yet. ··· 1171 1171 /* If auto-detecting, Determine the chip type. */ 1172 1172 if (kind <= 0) { 1173 1173 dev_dbg(&adapter->dev, "Autodetecting device at %d,0x%02x ...\n", 1174 - i2c_adapter_id(adapter), address ); 1175 - if( company == LM85_COMPANY_NATIONAL 1176 - && verstep == LM85_VERSTEP_LM85C ) { 1177 - kind = lm85c ; 1178 - } else if( company == LM85_COMPANY_NATIONAL 1179 - && verstep == LM85_VERSTEP_LM85B ) { 1180 - kind = lm85b ; 1181 - } else if( company == LM85_COMPANY_NATIONAL 1182 - && (verstep & LM85_VERSTEP_VMASK) == LM85_VERSTEP_GENERIC ) { 1174 + i2c_adapter_id(adapter), address); 1175 + if (company == LM85_COMPANY_NATIONAL 1176 + && verstep == LM85_VERSTEP_LM85C) { 1177 + kind = lm85c; 1178 + } else if (company == LM85_COMPANY_NATIONAL 1179 + && verstep == LM85_VERSTEP_LM85B) { 1180 + kind = lm85b; 1181 + } else if (company == LM85_COMPANY_NATIONAL 1182 + && (verstep & LM85_VERSTEP_VMASK) == LM85_VERSTEP_GENERIC) { 1183 1183 dev_err(&adapter->dev, "Unrecognized version/stepping 0x%02x" 1184 1184 " Defaulting to LM85.\n", verstep); 1185 - kind = any_chip ; 1186 - } else if( company == LM85_COMPANY_ANALOG_DEV 1187 - && verstep == LM85_VERSTEP_ADM1027 ) { 1188 - kind = adm1027 ; 1189 - } else if( company == LM85_COMPANY_ANALOG_DEV 1185 + kind = any_chip; 1186 + } else if (company == LM85_COMPANY_ANALOG_DEV 1187 + && verstep == LM85_VERSTEP_ADM1027) { 1188 + kind = adm1027; 1189 + } else if (company == LM85_COMPANY_ANALOG_DEV 1190 1190 && (verstep == LM85_VERSTEP_ADT7463 1191 - || verstep == LM85_VERSTEP_ADT7463C) ) { 1192 - kind = adt7463 ; 1193 - } else if( company == LM85_COMPANY_ANALOG_DEV 1194 - && (verstep & LM85_VERSTEP_VMASK) == LM85_VERSTEP_GENERIC ) { 1191 + || verstep == LM85_VERSTEP_ADT7463C)) { 1192 + kind = adt7463; 1193 + } else if (company == LM85_COMPANY_ANALOG_DEV 1194 + && (verstep & LM85_VERSTEP_VMASK) == LM85_VERSTEP_GENERIC) { 1195 1195 dev_err(&adapter->dev, "Unrecognized version/stepping 0x%02x" 1196 - " Defaulting to Generic LM85.\n", verstep ); 1197 - kind = any_chip ; 1198 - } else if( company == LM85_COMPANY_SMSC 1196 + " Defaulting to Generic LM85.\n", verstep); 1197 + kind = any_chip; 1198 + } else if (company == LM85_COMPANY_SMSC 1199 1199 && (verstep == LM85_VERSTEP_EMC6D100_A0 1200 - || verstep == LM85_VERSTEP_EMC6D100_A1) ) { 1200 + || verstep == LM85_VERSTEP_EMC6D100_A1)) { 1201 1201 /* Unfortunately, we can't tell a '100 from a '101 1202 1202 * from the registers. Since a '101 is a '100 1203 1203 * in a package with fewer pins and therefore no 1204 1204 * 3.3V, 1.5V or 1.8V inputs, perhaps if those 1205 1205 * inputs read 0, then it's a '101. 1206 1206 */ 1207 - kind = emc6d100 ; 1208 - } else if( company == LM85_COMPANY_SMSC 1207 + kind = emc6d100; 1208 + } else if (company == LM85_COMPANY_SMSC 1209 1209 && verstep == LM85_VERSTEP_EMC6D102) { 1210 - kind = emc6d102 ; 1211 - } else if( company == LM85_COMPANY_SMSC 1210 + kind = emc6d102; 1211 + } else if (company == LM85_COMPANY_SMSC 1212 1212 && (verstep & LM85_VERSTEP_VMASK) == LM85_VERSTEP_GENERIC) { 1213 1213 dev_err(&adapter->dev, "lm85: Detected SMSC chip\n"); 1214 1214 dev_err(&adapter->dev, "lm85: Unrecognized version/stepping 0x%02x" 1215 - " Defaulting to Generic LM85.\n", verstep ); 1216 - kind = any_chip ; 1217 - } else if( kind == any_chip 1215 + " Defaulting to Generic LM85.\n", verstep); 1216 + kind = any_chip; 1217 + } else if (kind == any_chip 1218 1218 && (verstep & LM85_VERSTEP_VMASK) == LM85_VERSTEP_GENERIC) { 1219 1219 dev_err(&adapter->dev, "Generic LM85 Version 6 detected\n"); 1220 1220 /* Leave kind as "any_chip" */ 1221 1221 } else { 1222 1222 dev_dbg(&adapter->dev, "Autodetection failed\n"); 1223 - /* Not an LM85 ... */ 1224 - if( kind == any_chip ) { /* User used force=x,y */ 1223 + /* Not an LM85... */ 1224 + if (kind == any_chip) { /* User used force=x,y */ 1225 1225 dev_err(&adapter->dev, "Generic LM85 Version 6 not" 1226 1226 " found at %d,0x%02x. Try force_lm85c.\n", 1227 - i2c_adapter_id(adapter), address ); 1227 + i2c_adapter_id(adapter), address); 1228 1228 } 1229 - err = 0 ; 1229 + err = 0; 1230 1230 goto ERROR1; 1231 1231 } 1232 1232 } 1233 1233 1234 1234 /* Fill in the chip specific driver values */ 1235 - if ( kind == any_chip ) { 1235 + if (kind == any_chip) 1236 1236 type_name = "lm85"; 1237 - } else if ( kind == lm85b ) { 1237 + else if (kind == lm85b) 1238 1238 type_name = "lm85b"; 1239 - } else if ( kind == lm85c ) { 1239 + else if (kind == lm85c) 1240 1240 type_name = "lm85c"; 1241 - } else if ( kind == adm1027 ) { 1241 + else if (kind == adm1027) 1242 1242 type_name = "adm1027"; 1243 - } else if ( kind == adt7463 ) { 1243 + else if (kind == adt7463) 1244 1244 type_name = "adt7463"; 1245 - } else if ( kind == emc6d100){ 1245 + else if (kind == emc6d100) 1246 1246 type_name = "emc6d100"; 1247 - } else if ( kind == emc6d102 ) { 1247 + else if (kind == emc6d102) 1248 1248 type_name = "emc6d102"; 1249 - } 1250 1249 strlcpy(new_client->name, type_name, I2C_NAME_SIZE); 1251 1250 1252 1251 /* Fill in the remaining client fields */ ··· 1290 1291 return 0; 1291 1292 1292 1293 /* Error out and cleanup code */ 1293 - ERROR3: 1294 + ERROR3: 1294 1295 sysfs_remove_group(&new_client->dev.kobj, &lm85_group); 1295 1296 sysfs_remove_group(&new_client->dev.kobj, &lm85_group_in4); 1296 1297 if (kind == emc6d100) 1297 1298 sysfs_remove_group(&new_client->dev.kobj, &lm85_group_in567); 1298 - ERROR2: 1299 + ERROR2: 1299 1300 i2c_detach_client(new_client); 1300 - ERROR1: 1301 + ERROR1: 1301 1302 kfree(data); 1302 - ERROR0: 1303 + ERROR0: 1303 1304 return err; 1304 1305 } 1305 1306 ··· 1322 1323 int res; 1323 1324 1324 1325 /* What size location is it? */ 1325 - switch( reg ) { 1326 - case LM85_REG_FAN(0) : /* Read WORD data */ 1327 - case LM85_REG_FAN(1) : 1328 - case LM85_REG_FAN(2) : 1329 - case LM85_REG_FAN(3) : 1330 - case LM85_REG_FAN_MIN(0) : 1331 - case LM85_REG_FAN_MIN(1) : 1332 - case LM85_REG_FAN_MIN(2) : 1333 - case LM85_REG_FAN_MIN(3) : 1334 - case LM85_REG_ALARM1 : /* Read both bytes at once */ 1335 - res = i2c_smbus_read_byte_data(client, reg) & 0xff ; 1336 - res |= i2c_smbus_read_byte_data(client, reg+1) << 8 ; 1337 - break ; 1338 - case ADT7463_REG_TMIN_CTL1 : /* Read WORD MSB, LSB */ 1339 - res = i2c_smbus_read_byte_data(client, reg) << 8 ; 1340 - res |= i2c_smbus_read_byte_data(client, reg+1) & 0xff ; 1341 - break ; 1326 + switch (reg) { 1327 + case LM85_REG_FAN(0): /* Read WORD data */ 1328 + case LM85_REG_FAN(1): 1329 + case LM85_REG_FAN(2): 1330 + case LM85_REG_FAN(3): 1331 + case LM85_REG_FAN_MIN(0): 1332 + case LM85_REG_FAN_MIN(1): 1333 + case LM85_REG_FAN_MIN(2): 1334 + case LM85_REG_FAN_MIN(3): 1335 + case LM85_REG_ALARM1: /* Read both bytes at once */ 1336 + res = i2c_smbus_read_byte_data(client, reg) & 0xff; 1337 + res |= i2c_smbus_read_byte_data(client, reg + 1) << 8; 1338 + break; 1339 + case ADT7463_REG_TMIN_CTL1: /* Read WORD MSB, LSB */ 1340 + res = i2c_smbus_read_byte_data(client, reg) << 8; 1341 + res |= i2c_smbus_read_byte_data(client, reg + 1) & 0xff; 1342 + break; 1342 1343 default: /* Read BYTE data */ 1343 1344 res = i2c_smbus_read_byte_data(client, reg); 1344 - break ; 1345 + break; 1345 1346 } 1346 1347 1347 - return res ; 1348 + return res; 1348 1349 } 1349 1350 1350 1351 static int lm85_write_value(struct i2c_client *client, u8 reg, int value) 1351 1352 { 1352 - int res ; 1353 + int res; 1353 1354 1354 - switch( reg ) { 1355 - case LM85_REG_FAN(0) : /* Write WORD data */ 1356 - case LM85_REG_FAN(1) : 1357 - case LM85_REG_FAN(2) : 1358 - case LM85_REG_FAN(3) : 1359 - case LM85_REG_FAN_MIN(0) : 1360 - case LM85_REG_FAN_MIN(1) : 1361 - case LM85_REG_FAN_MIN(2) : 1362 - case LM85_REG_FAN_MIN(3) : 1355 + switch (reg) { 1356 + case LM85_REG_FAN(0): /* Write WORD data */ 1357 + case LM85_REG_FAN(1): 1358 + case LM85_REG_FAN(2): 1359 + case LM85_REG_FAN(3): 1360 + case LM85_REG_FAN_MIN(0): 1361 + case LM85_REG_FAN_MIN(1): 1362 + case LM85_REG_FAN_MIN(2): 1363 + case LM85_REG_FAN_MIN(3): 1363 1364 /* NOTE: ALARM is read only, so not included here */ 1364 - res = i2c_smbus_write_byte_data(client, reg, value & 0xff) ; 1365 - res |= i2c_smbus_write_byte_data(client, reg+1, (value>>8) & 0xff) ; 1366 - break ; 1367 - case ADT7463_REG_TMIN_CTL1 : /* Write WORD MSB, LSB */ 1368 - res = i2c_smbus_write_byte_data(client, reg, (value>>8) & 0xff); 1369 - res |= i2c_smbus_write_byte_data(client, reg+1, value & 0xff) ; 1370 - break ; 1365 + res = i2c_smbus_write_byte_data(client, reg, value & 0xff); 1366 + res |= i2c_smbus_write_byte_data(client, reg + 1, 1367 + (value >> 8) & 0xff); 1368 + break; 1369 + case ADT7463_REG_TMIN_CTL1: /* Write WORD MSB, LSB */ 1370 + res = i2c_smbus_write_byte_data(client, reg, 1371 + (value >> 8) & 0xff); 1372 + res |= i2c_smbus_write_byte_data(client, reg + 1, value & 0xff); 1373 + break; 1371 1374 default: /* Write BYTE data */ 1372 1375 res = i2c_smbus_write_byte_data(client, reg, value); 1373 - break ; 1376 + break; 1374 1377 } 1375 1378 1376 - return res ; 1379 + return res; 1377 1380 } 1378 1381 1379 1382 static void lm85_init_client(struct i2c_client *client) ··· 1388 1387 /* Warn if part was not "READY" */ 1389 1388 value = lm85_read_value(client, LM85_REG_CONFIG); 1390 1389 dev_dbg(&client->dev, "LM85_REG_CONFIG is: 0x%02x\n", value); 1391 - if( value & 0x02 ) { 1390 + if (value & 0x02) { 1392 1391 dev_err(&client->dev, "Client (%d,0x%02x) config is locked.\n", 1393 - i2c_adapter_id(client->adapter), client->addr ); 1394 - }; 1395 - if( ! (value & 0x04) ) { 1392 + i2c_adapter_id(client->adapter), client->addr); 1393 + } 1394 + if (!(value & 0x04)) { 1396 1395 dev_err(&client->dev, "Client (%d,0x%02x) is not ready.\n", 1397 - i2c_adapter_id(client->adapter), client->addr ); 1398 - }; 1399 - if( value & 0x10 1400 - && ( data->type == adm1027 1401 - || data->type == adt7463 ) ) { 1396 + i2c_adapter_id(client->adapter), client->addr); 1397 + } 1398 + if (value & 0x10 1399 + && (data->type == adm1027 1400 + || data->type == adt7463)) { 1402 1401 dev_err(&client->dev, "Client (%d,0x%02x) VxI mode is set. " 1403 1402 "Please report this to the lm85 maintainer.\n", 1404 - i2c_adapter_id(client->adapter), client->addr ); 1405 - }; 1403 + i2c_adapter_id(client->adapter), client->addr); 1404 + } 1406 1405 1407 1406 /* WE INTENTIONALLY make no changes to the limits, 1408 1407 * offsets, pwms, fans and zones. If they were ··· 1415 1414 /* Start monitoring */ 1416 1415 value = lm85_read_value(client, LM85_REG_CONFIG); 1417 1416 /* Try to clear LOCK, Set START, save everything else */ 1418 - value = (value & ~ 0x02) | 0x01 ; 1417 + value = (value & ~0x02) | 0x01; 1419 1418 dev_dbg(&client->dev, "Setting CONFIG to: 0x%02x\n", value); 1420 1419 lm85_write_value(client, LM85_REG_CONFIG, value); 1421 1420 } ··· 1428 1427 1429 1428 mutex_lock(&data->update_lock); 1430 1429 1431 - if ( !data->valid || 1432 - time_after(jiffies, data->last_reading + LM85_DATA_INTERVAL) ) { 1430 + if (!data->valid || 1431 + time_after(jiffies, data->last_reading + LM85_DATA_INTERVAL)) { 1433 1432 /* Things that change quickly */ 1434 1433 dev_dbg(&client->dev, "Reading sensor values\n"); 1435 - 1434 + 1436 1435 /* Have to read extended bits first to "freeze" the 1437 1436 * more significant bits that are read later. 1438 1437 * There are 2 additional resolution bits per channel and we 1439 1438 * have room for 4, so we shift them to the left. 1440 1439 */ 1441 - if ( (data->type == adm1027) || (data->type == adt7463) ) { 1440 + if (data->type == adm1027 || data->type == adt7463) { 1442 1441 int ext1 = lm85_read_value(client, 1443 1442 ADM1027_REG_EXTEND_ADC1); 1444 1443 int ext2 = lm85_read_value(client, 1445 1444 ADM1027_REG_EXTEND_ADC2); 1446 1445 int val = (ext1 << 8) + ext2; 1447 1446 1448 - for(i = 0; i <= 4; i++) 1449 - data->in_ext[i] = ((val>>(i * 2))&0x03) << 2; 1447 + for (i = 0; i <= 4; i++) 1448 + data->in_ext[i] = 1449 + ((val >> (i * 2)) & 0x03) << 2; 1450 1450 1451 - for(i = 0; i <= 2; i++) 1452 - data->temp_ext[i] = (val>>((i + 4) * 2))&0x0c; 1451 + for (i = 0; i <= 2; i++) 1452 + data->temp_ext[i] = 1453 + (val >> ((i + 4) * 2)) & 0x0c; 1453 1454 } 1454 1455 1455 1456 data->vid = lm85_read_value(client, LM85_REG_VID); ··· 1483 1480 1484 1481 data->alarms = lm85_read_value(client, LM85_REG_ALARM1); 1485 1482 1486 - if ( data->type == adt7463 ) { 1487 - if( data->therm_total < ULONG_MAX - 256 ) { 1483 + if (data->type == adt7463) { 1484 + if (data->therm_total < ULONG_MAX - 256) { 1488 1485 data->therm_total += 1489 - lm85_read_value(client, ADT7463_REG_THERM ); 1486 + lm85_read_value(client, ADT7463_REG_THERM); 1490 1487 } 1491 - } else if ( data->type == emc6d100 ) { 1488 + } else if (data->type == emc6d100) { 1492 1489 /* Three more voltage sensors */ 1493 1490 for (i = 5; i <= 7; ++i) { 1494 - data->in[i] = 1495 - lm85_read_value(client, EMC6D100_REG_IN(i)); 1491 + data->in[i] = lm85_read_value(client, 1492 + EMC6D100_REG_IN(i)); 1496 1493 } 1497 1494 /* More alarm bits */ 1498 - data->alarms |= 1499 - lm85_read_value(client, EMC6D100_REG_ALARM3) << 16; 1500 - } else if (data->type == emc6d102 ) { 1495 + data->alarms |= lm85_read_value(client, 1496 + EMC6D100_REG_ALARM3) << 16; 1497 + } else if (data->type == emc6d102) { 1501 1498 /* Have to read LSB bits after the MSB ones because 1502 1499 the reading of the MSB bits has frozen the 1503 1500 LSBs (backward from the ADM1027). ··· 1521 1518 data->temp_ext[2] = (ext1 >> 4) & 0x0f; 1522 1519 } 1523 1520 1524 - data->last_reading = jiffies ; 1525 - }; /* last_reading */ 1521 + data->last_reading = jiffies; 1522 + } /* last_reading */ 1526 1523 1527 - if ( !data->valid || 1528 - time_after(jiffies, data->last_config + LM85_CONFIG_INTERVAL) ) { 1524 + if (!data->valid || 1525 + time_after(jiffies, data->last_config + LM85_CONFIG_INTERVAL)) { 1529 1526 /* Things that don't change often */ 1530 1527 dev_dbg(&client->dev, "Reading config values\n"); 1531 1528 ··· 1543 1540 LM85_REG_IN_MAX(4)); 1544 1541 } 1545 1542 1546 - if ( data->type == emc6d100 ) { 1543 + if (data->type == emc6d100) { 1547 1544 for (i = 5; i <= 7; ++i) { 1548 - data->in_min[i] = 1549 - lm85_read_value(client, EMC6D100_REG_IN_MIN(i)); 1550 - data->in_max[i] = 1551 - lm85_read_value(client, EMC6D100_REG_IN_MAX(i)); 1545 + data->in_min[i] = lm85_read_value(client, 1546 + EMC6D100_REG_IN_MIN(i)); 1547 + data->in_max[i] = lm85_read_value(client, 1548 + EMC6D100_REG_IN_MAX(i)); 1552 1549 } 1553 1550 } 1554 1551 ··· 1565 1562 } 1566 1563 1567 1564 for (i = 0; i <= 2; ++i) { 1568 - int val ; 1565 + int val; 1569 1566 data->autofan[i].config = 1570 1567 lm85_read_value(client, LM85_REG_AFAN_CONFIG(i)); 1571 1568 val = lm85_read_value(client, LM85_REG_AFAN_RANGE(i)); 1572 - data->autofan[i].freq = val & 0x07 ; 1573 - data->zone[i].range = (val >> 4) & 0x0f ; 1569 + data->autofan[i].freq = val & 0x07; 1570 + data->zone[i].range = (val >> 4) & 0x0f; 1574 1571 data->autofan[i].min_pwm = 1575 1572 lm85_read_value(client, LM85_REG_AFAN_MINPWM(i)); 1576 1573 data->zone[i].limit = ··· 1580 1577 } 1581 1578 1582 1579 i = lm85_read_value(client, LM85_REG_AFAN_SPIKE1); 1583 - data->smooth[0] = i & 0x0f ; 1584 - data->syncpwm3 = i & 0x10 ; /* Save PWM3 config */ 1585 - data->autofan[0].min_off = (i & 0x20) != 0 ; 1586 - data->autofan[1].min_off = (i & 0x40) != 0 ; 1587 - data->autofan[2].min_off = (i & 0x80) != 0 ; 1580 + data->smooth[0] = i & 0x0f; 1581 + data->syncpwm3 = i & 0x10; /* Save PWM3 config */ 1582 + data->autofan[0].min_off = (i & 0x20) != 0; 1583 + data->autofan[1].min_off = (i & 0x40) != 0; 1584 + data->autofan[2].min_off = (i & 0x80) != 0; 1588 1585 i = lm85_read_value(client, LM85_REG_AFAN_SPIKE2); 1589 - data->smooth[1] = (i>>4) & 0x0f ; 1590 - data->smooth[2] = i & 0x0f ; 1586 + data->smooth[1] = (i >> 4) & 0x0f; 1587 + data->smooth[2] = i & 0x0f; 1591 1588 1592 1589 i = lm85_read_value(client, LM85_REG_AFAN_HYST1); 1593 - data->zone[0].hyst = (i>>4) & 0x0f ; 1594 - data->zone[1].hyst = i & 0x0f ; 1590 + data->zone[0].hyst = (i >> 4) & 0x0f; 1591 + data->zone[1].hyst = i & 0x0f; 1595 1592 1596 1593 i = lm85_read_value(client, LM85_REG_AFAN_HYST2); 1597 - data->zone[2].hyst = (i>>4) & 0x0f ; 1594 + data->zone[2].hyst = (i >> 4) & 0x0f; 1598 1595 1599 - if ( (data->type == lm85b) || (data->type == lm85c) ) { 1596 + if (data->type == lm85b || data->type == lm85c) { 1600 1597 data->tach_mode = lm85_read_value(client, 1601 - LM85_REG_TACH_MODE ); 1598 + LM85_REG_TACH_MODE); 1602 1599 data->spinup_ctl = lm85_read_value(client, 1603 - LM85_REG_SPINUP_CTL ); 1604 - } else if ( (data->type == adt7463) || (data->type == adm1027) ) { 1605 - if ( data->type == adt7463 ) { 1600 + LM85_REG_SPINUP_CTL); 1601 + } else if (data->type == adt7463 || data->type == adm1027) { 1602 + if (data->type == adt7463) { 1606 1603 for (i = 0; i <= 2; ++i) { 1607 1604 data->oppoint[i] = lm85_read_value(client, 1608 - ADT7463_REG_OPPOINT(i) ); 1605 + ADT7463_REG_OPPOINT(i)); 1609 1606 } 1610 1607 data->tmin_ctl = lm85_read_value(client, 1611 - ADT7463_REG_TMIN_CTL1 ); 1608 + ADT7463_REG_TMIN_CTL1); 1612 1609 data->therm_limit = lm85_read_value(client, 1613 - ADT7463_REG_THERM_LIMIT ); 1610 + ADT7463_REG_THERM_LIMIT); 1614 1611 } 1615 1612 for (i = 0; i <= 2; ++i) { 1616 - data->temp_offset[i] = lm85_read_value(client, 1617 - ADM1027_REG_TEMP_OFFSET(i) ); 1613 + data->temp_offset[i] = lm85_read_value(client, 1614 + ADM1027_REG_TEMP_OFFSET(i)); 1618 1615 } 1619 1616 data->tach_mode = lm85_read_value(client, 1620 - ADM1027_REG_CONFIG3 ); 1617 + ADM1027_REG_CONFIG3); 1621 1618 data->fan_ppr = lm85_read_value(client, 1622 - ADM1027_REG_FAN_PPR ); 1619 + ADM1027_REG_FAN_PPR); 1623 1620 } 1624 - 1621 + 1625 1622 data->last_config = jiffies; 1626 - }; /* last_config */ 1623 + } /* last_config */ 1627 1624 1628 1625 data->valid = 1; 1629 1626 ··· 1638 1635 return i2c_add_driver(&lm85_driver); 1639 1636 } 1640 1637 1641 - static void __exit sm_lm85_exit(void) 1638 + static void __exit sm_lm85_exit(void) 1642 1639 { 1643 1640 i2c_del_driver(&lm85_driver); 1644 1641 } ··· 1648 1645 * post 2.7.0 CVS changes. 1649 1646 */ 1650 1647 MODULE_LICENSE("GPL"); 1651 - MODULE_AUTHOR("Philip Pokorny <ppokorny@penguincomputing.com>, Margit Schubert-While <margitsw@t-online.de>, Justin Thiessen <jthiessen@penguincomputing.com"); 1648 + MODULE_AUTHOR("Philip Pokorny <ppokorny@penguincomputing.com>, " 1649 + "Margit Schubert-While <margitsw@t-online.de>, " 1650 + "Justin Thiessen <jthiessen@penguincomputing.com"); 1652 1651 MODULE_DESCRIPTION("LM85-B, LM85-C driver"); 1653 1652 1654 1653 module_init(sm_lm85_init);