Changeset 46
- Timestamp:
- 12/07/98 23:15:49 (14 years ago)
- Location:
- lm-sensors/trunk
- Files:
-
- 8 modified
-
kernel/chips/lm75.c (modified) (2 diffs)
-
kernel/chips/lm78.c (modified) (2 diffs)
-
kernel/i2c-proc.c (modified) (1 diff)
-
kernel/sensors.c (modified) (4 diffs)
-
src/i2c-proc.c (modified) (1 diff)
-
src/lm75.c (modified) (2 diffs)
-
src/lm78.c (modified) (2 diffs)
-
src/sensors.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/kernel/chips/lm75.c
r40 r46 222 222 void lm75_inc_use (struct i2c_client *client) 223 223 { 224 #ifdef MODULE 225 MOD_INC_USE_COUNT; 226 #endif 224 227 } 225 228 … … 227 230 void lm75_dec_use (struct i2c_client *client) 228 231 { 232 #ifdef MODULE 233 MOD_DEC_USE_COUNT; 234 #endif 229 235 } 230 236 -
lm-sensors/trunk/kernel/chips/lm78.c
r36 r46 584 584 void lm78_inc_use (struct i2c_client *client) 585 585 { 586 #ifdef MODULE 587 MOD_INC_USE_COUNT; 588 #endif 586 589 } 587 590 … … 589 592 void lm78_dec_use (struct i2c_client *client) 590 593 { 594 #ifdef MODULE 595 MOD_DEC_USE_COUNT; 596 #endif 591 597 } 592 598 -
lm-sensors/trunk/kernel/i2c-proc.c
r43 r46 436 436 } 437 437 438 439 438 #ifdef MODULE 440 439 -
lm-sensors/trunk/kernel/sensors.c
r39 r46 22 22 #include <linux/ctype.h> 23 23 #include <linux/sysctl.h> 24 #include <linux/proc_fs.h> 24 25 25 26 #include "version.h" … … 47 48 #define SENSORS_ENTRY_MAX 20 48 49 static struct ctl_table_header *sensors_entries[SENSORS_ENTRY_MAX]; 50 51 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 52 static struct i2c_client *sensors_clients[SENSORS_ENTRY_MAX]; 53 static unsigned short sensors_inodes[SENSORS_ENTRY_MAX]; 54 void sensors_fill_inode(struct inode *inode, int fill); 55 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */ 49 56 50 57 static ctl_table sysctl_table[] = { … … 136 143 sensors_entries[id-256] = new_header; 137 144 145 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 146 sensors_clients[id-256] = client; 147 #ifdef DEBUG 148 if (!new_header || !new_header->ctl_table || 149 !new_header->ctl_table->child || 150 !new_header->ctl_table->child->child || 151 !new_header->ctl_table->child->child->de) { 152 printk("sensors.o: NULL pointer when trying to install fill_inode fix!\n"); 153 return id; 154 } 155 #endif /* DEBUG */ 156 sensors_inodes[id-256] = new_header->ctl_table->child->child->de->low_ino; 157 new_header->ctl_table->child->child->de->fill_inode = &sensors_fill_inode; 158 #endif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 159 138 160 return id; 139 161 } … … 148 170 kfree((void *) (table[4].procname)); 149 171 kfree(table); 150 sensors_entries[id] = 0; 151 } 152 } 172 sensors_entries[id] = NULL; 173 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 174 sensors_clients[id-256] = NULL; 175 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */ 176 } 177 } 178 179 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 180 void sensors_fill_inode(struct inode *inode, int fill) 181 { 182 int i; 183 struct i2c_client *client; 184 185 #ifdef DEBUG 186 if (! inode) { 187 printk("sensors.o: Warning: inode NULL in fill_inode()\n"); 188 return; 189 } 190 #endif /* def DEBUG */ 191 192 for (i = 0; i < SENSORS_ENTRY_MAX; i++) 193 if (sensors_clients[i] && (sensors_inodes[i] == inode->i_ino)) 194 break; 195 #ifdef DEBUG 196 if (i == SENSORS_ENTRY_MAX) { 197 printk("sensors.o: Warning: inode (%ld) not found in fill_inode()\n", 198 inode->i_ino); 199 return; 200 } 201 #endif /* def DEBUG */ 202 client = sensors_clients[i]; 203 if (fill) 204 client->driver->inc_use(client); 205 else 206 client->driver->dec_use(client); 207 } 208 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */ 153 209 154 210 /* This funcion reads or writes a 'real' value (encoded by the combination -
lm-sensors/trunk/src/i2c-proc.c
r43 r46 436 436 } 437 437 438 439 438 #ifdef MODULE 440 439 -
lm-sensors/trunk/src/lm75.c
r40 r46 222 222 void lm75_inc_use (struct i2c_client *client) 223 223 { 224 #ifdef MODULE 225 MOD_INC_USE_COUNT; 226 #endif 224 227 } 225 228 … … 227 230 void lm75_dec_use (struct i2c_client *client) 228 231 { 232 #ifdef MODULE 233 MOD_DEC_USE_COUNT; 234 #endif 229 235 } 230 236 -
lm-sensors/trunk/src/lm78.c
r36 r46 584 584 void lm78_inc_use (struct i2c_client *client) 585 585 { 586 #ifdef MODULE 587 MOD_INC_USE_COUNT; 588 #endif 586 589 } 587 590 … … 589 592 void lm78_dec_use (struct i2c_client *client) 590 593 { 594 #ifdef MODULE 595 MOD_DEC_USE_COUNT; 596 #endif 591 597 } 592 598 -
lm-sensors/trunk/src/sensors.c
r39 r46 22 22 #include <linux/ctype.h> 23 23 #include <linux/sysctl.h> 24 #include <linux/proc_fs.h> 24 25 25 26 #include "version.h" … … 47 48 #define SENSORS_ENTRY_MAX 20 48 49 static struct ctl_table_header *sensors_entries[SENSORS_ENTRY_MAX]; 50 51 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 52 static struct i2c_client *sensors_clients[SENSORS_ENTRY_MAX]; 53 static unsigned short sensors_inodes[SENSORS_ENTRY_MAX]; 54 void sensors_fill_inode(struct inode *inode, int fill); 55 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */ 49 56 50 57 static ctl_table sysctl_table[] = { … … 136 143 sensors_entries[id-256] = new_header; 137 144 145 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 146 sensors_clients[id-256] = client; 147 #ifdef DEBUG 148 if (!new_header || !new_header->ctl_table || 149 !new_header->ctl_table->child || 150 !new_header->ctl_table->child->child || 151 !new_header->ctl_table->child->child->de) { 152 printk("sensors.o: NULL pointer when trying to install fill_inode fix!\n"); 153 return id; 154 } 155 #endif /* DEBUG */ 156 sensors_inodes[id-256] = new_header->ctl_table->child->child->de->low_ino; 157 new_header->ctl_table->child->child->de->fill_inode = &sensors_fill_inode; 158 #endif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 159 138 160 return id; 139 161 } … … 148 170 kfree((void *) (table[4].procname)); 149 171 kfree(table); 150 sensors_entries[id] = 0; 151 } 152 } 172 sensors_entries[id] = NULL; 173 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 174 sensors_clients[id-256] = NULL; 175 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */ 176 } 177 } 178 179 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 180 void sensors_fill_inode(struct inode *inode, int fill) 181 { 182 int i; 183 struct i2c_client *client; 184 185 #ifdef DEBUG 186 if (! inode) { 187 printk("sensors.o: Warning: inode NULL in fill_inode()\n"); 188 return; 189 } 190 #endif /* def DEBUG */ 191 192 for (i = 0; i < SENSORS_ENTRY_MAX; i++) 193 if (sensors_clients[i] && (sensors_inodes[i] == inode->i_ino)) 194 break; 195 #ifdef DEBUG 196 if (i == SENSORS_ENTRY_MAX) { 197 printk("sensors.o: Warning: inode (%ld) not found in fill_inode()\n", 198 inode->i_ino); 199 return; 200 } 201 #endif /* def DEBUG */ 202 client = sensors_clients[i]; 203 if (fill) 204 client->driver->inc_use(client); 205 else 206 client->driver->dec_use(client); 207 } 208 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */ 153 209 154 210 /* This funcion reads or writes a 'real' value (encoded by the combination
