Changeset 68

Show
Ignore:
Timestamp:
12/11/98 16:07:29 (10 years ago)
Author:
frodo
Message:

Some small bug fixes

* Somehow, i2c-proc did not yet use the i2c_adapter_id call. This must have

slipped through.

* isa.o and smbus.o changes I made to make them less noisy had a small

error (no return value), which caused strange device detections.

* Added /proc/bus/i2c module-count monitoring - somehow, this slipped

through, too.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lm-sensors/trunk/kernel/busses/i2c-isa.c

    r67 r68  
    8080         "(no i2c level access possible!)\n", 
    8181         adap->name); 
     82#endif 
    8283  return -1; 
    83 #endif 
    8484} 
    8585 
     
    9191         "(no i2c level access possible!)\n", 
    9292         adap->name); 
     93#endif 
    9394  return -1; 
    94 #endif 
    9595} 
    9696 
     
    102102         "(no i2c level access possible!)\n", 
    103103         adap->name); 
     104#endif 
    104105  return -1; 
    105 #endif 
    106106} 
    107107 
  • lm-sensors/trunk/kernel/i2c-proc.c

    r67 r68  
    157157  } 
    158158  proc_bus_i2c = create_proc_entry("i2c",0,proc_bus); 
    159   if (proc_bus_i2c) 
    160     proc_bus_i2c->read_proc = &read_bus_i2c; 
    161   else { 
     159  if (!proc_bus_i2c) { 
    162160    printk("i2c-proc.o: Could not create /proc/bus/i2c, " 
    163161           "module not inserted.\n"); 
     
    165163    return -ENOENT; 
    166164  } 
     165  proc_bus_i2c->read_proc = &read_bus_i2c; 
     166#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,29)) 
     167  proc_bus_i2c->fill_inode = &monitor_bus_i2c; 
     168#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,29)) */ 
    167169  i2cproc_initialized += 2; 
    168170#else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,29)) */ 
     
    253255  for (i = 0; i < I2C_ADAP_MAX; i++) 
    254256    if (i2cproc_adapters[i]) 
    255       len += sprintf(buf+len, "i2c-%d\t%s\t%-32s\t%-32s\n",i, 
     257      len += sprintf(buf+len, "i2c-%d\t%s\t%-32s\t%-32s\n", 
     258                     i2c_adapter_id(i2cproc_adapters[i]), 
    256259                     i2c_is_smbus_adapter(i2cproc_adapters[i])?"smbus": 
    257260#ifdef DEBUG 
     
    357360  i2cproc_adapters[i] = adapter; 
    358361 
    359   sprintf(name,"i2c-%d",i); 
     362  sprintf(name,"i2c-%d",i2c_adapter_id(adapter)); 
    360363 
    361364#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,29)) 
     
    414417    if (client->adapter == i2cproc_adapters[i]) { 
    415418#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,29)) 
    416       sprintf(name,"i2c-%d",i); 
     419      sprintf(name,"i2c-%d",i2c_adapter_id(i2cproc_adapters[i])); 
    417420      remove_proc_entry(name,proc_bus); 
    418421#else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,29)) */ 
  • lm-sensors/trunk/kernel/smbus.c

    r67 r68  
    192192         "(no i2c level access possible!)\n", 
    193193         adap->name); 
     194#endif 
    194195  return -1; 
    195 #endif 
    196196} 
    197197 
     
    203203         "(no i2c level access possible!)\n", 
    204204         adap->name); 
     205#endif 
    205206  return -1; 
    206 #endif 
    207207} 
    208208 
     
    214214         "(no i2c level access possible!)\n", 
    215215         adap->name); 
     216#endif 
    216217  return -1; 
    217 #endif 
    218218} 
    219219 
  • lm-sensors/trunk/src/i2c-proc.c

    r67 r68  
    157157  } 
    158158  proc_bus_i2c = create_proc_entry("i2c",0,proc_bus); 
    159   if (proc_bus_i2c) 
    160     proc_bus_i2c->read_proc = &read_bus_i2c; 
    161   else { 
     159  if (!proc_bus_i2c) { 
    162160    printk("i2c-proc.o: Could not create /proc/bus/i2c, " 
    163161           "module not inserted.\n"); 
     
    165163    return -ENOENT; 
    166164  } 
     165  proc_bus_i2c->read_proc = &read_bus_i2c; 
     166#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,29)) 
     167  proc_bus_i2c->fill_inode = &monitor_bus_i2c; 
     168#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,29)) */ 
    167169  i2cproc_initialized += 2; 
    168170#else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,29)) */ 
     
    253255  for (i = 0; i < I2C_ADAP_MAX; i++) 
    254256    if (i2cproc_adapters[i]) 
    255       len += sprintf(buf+len, "i2c-%d\t%s\t%-32s\t%-32s\n",i, 
     257      len += sprintf(buf+len, "i2c-%d\t%s\t%-32s\t%-32s\n", 
     258                     i2c_adapter_id(i2cproc_adapters[i]), 
    256259                     i2c_is_smbus_adapter(i2cproc_adapters[i])?"smbus": 
    257260#ifdef DEBUG 
     
    357360  i2cproc_adapters[i] = adapter; 
    358361 
    359   sprintf(name,"i2c-%d",i); 
     362  sprintf(name,"i2c-%d",i2c_adapter_id(adapter)); 
    360363 
    361364#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,29)) 
     
    414417    if (client->adapter == i2cproc_adapters[i]) { 
    415418#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,29)) 
    416       sprintf(name,"i2c-%d",i); 
     419      sprintf(name,"i2c-%d",i2c_adapter_id(i2cproc_adapters[i])); 
    417420      remove_proc_entry(name,proc_bus); 
    418421#else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,29)) */ 
  • lm-sensors/trunk/src/isa.c

    r67 r68  
    8080         "(no i2c level access possible!)\n", 
    8181         adap->name); 
     82#endif 
    8283  return -1; 
    83 #endif 
    8484} 
    8585 
     
    9191         "(no i2c level access possible!)\n", 
    9292         adap->name); 
     93#endif 
    9394  return -1; 
    94 #endif 
    9595} 
    9696 
     
    102102         "(no i2c level access possible!)\n", 
    103103         adap->name); 
     104#endif 
    104105  return -1; 
    105 #endif 
    106106} 
    107107 
  • lm-sensors/trunk/src/smbus.c

    r67 r68  
    192192         "(no i2c level access possible!)\n", 
    193193         adap->name); 
     194#endif 
    194195  return -1; 
    195 #endif 
    196196} 
    197197 
     
    203203         "(no i2c level access possible!)\n", 
    204204         adap->name); 
     205#endif 
    205206  return -1; 
    206 #endif 
    207207} 
    208208 
     
    214214         "(no i2c level access possible!)\n", 
    215215         adap->name); 
     216#endif 
    216217  return -1; 
    217 #endif 
    218218} 
    219219