Changeset 2719 for lm-sensors/trunk/kernel/chips/lm87.c
- Timestamp:
- 10/10/04 14:03:48 (9 years ago)
- Files:
-
- 1 modified
-
lm-sensors/trunk/kernel/chips/lm87.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/kernel/chips/lm87.c
r2717 r2719 28 28 #include <linux/i2c-proc.h> 29 29 #include <linux/init.h> 30 #include <linux/delay.h> 30 31 #include "version.h" 31 32 #include "sensors_vid.h" … … 469 470 470 471 if ((err = i2c_detach_client(client))) { 471 printk 472 ("lm87.o: Client deregistration failed, client not detached.\n");472 printk(KERN_ERR "lm87.o: Client deregistration failed, " 473 "client not detached\n"); 473 474 return err; 474 475 } … … 479 480 } 480 481 482 #define MAX_RETRIES 5 483 481 484 static int lm87_read_value(struct i2c_client *client, u8 reg) 482 485 { 483 return 0xFF & i2c_smbus_read_byte_data(client, reg); 486 int value, i; 487 488 /* Retry in case of read errors */ 489 for (i = 1; i <= MAX_RETRIES; i++) { 490 if ((value = i2c_smbus_read_byte_data(client, reg)) >= 0) 491 return value; 492 493 printk(KERN_WARNING "lm87.o: Read byte data failed, " 494 "address 0x%02x\n", reg); 495 mdelay(i); 496 } 497 498 /* <TODO> what to return in case of error? */ 499 return 0; 484 500 } 485 501 … … 944 960 static int __init sm_lm87_init(void) 945 961 { 946 printk( "lm87.o version %s (%s)\n", LM_VERSION, LM_DATE);962 printk(KERN_INFO "lm87.o version %s (%s)\n", LM_VERSION, LM_DATE); 947 963 return i2c_add_driver(&LM87_driver); 948 964 }
