Changeset 3613

Show
Ignore:
Timestamp:
02/19/02 02:06:01 (11 years ago)
Author:
mds
Message:

add printk to i2c-proc if no sysctl support in kernel and

return -EPERM. Was mysterious -ENOMEM with no printk.
Also add dependency to Config.in.

Subject:

Problem: i2c-proc w/o sysctl support

Date:

Mon, 18 Feb 2002 16:14:16 +0100

From:

"Sebastian Brandt" <SBrandt@…>

To:

<sensors@…>

Dear Developers,
when I tried to use i2c and lm_sensors, it mysteriously failed for me - of
course, for me only, like usual.
Loading i2c-proc.o resulted in out-of-memory error, with the usual
modprobe/insmod explanation about wrong irqs or io ports. Looking at the
code an debugging, I found out that register_sysctl_table fails. Fittingly,
/proc/sys did not exist. Syctl-support was not compiled into the kernel.

Resume:
If syctl is not supported, i2c-proc.c does not really do anything. Still, it
should either load silently and keep silent or check for CONFIG_SYSCTL=y
when compiling. None of the i2c-modules can live w/o it.

thanks,
Sebastian Brandt

Location:
i2c/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • i2c/trunk/kernel/i2c-proc.c

    r3611 r3613  
    179179 
    180180        if (!(new_header = register_sysctl_table(new_table, 0))) { 
     181                printk(KERN_ERR "i2c-proc.o: error: sysctl interface not supported by kernel!\n"); 
    181182                kfree(new_table); 
    182183                kfree(name); 
    183                 return -ENOMEM; 
     184                return -EPERM; 
    184185        } 
    185186 
     
    879880        if (! 
    880881            (i2c_proc_header = 
    881              register_sysctl_table(i2c_proc, 0))) return -ENOMEM; 
     882             register_sysctl_table(i2c_proc, 0))) { 
     883                printk(KERN_ERR "i2c-proc.o: error: sysctl interface not supported by kernel!\n"); 
     884                return -EPERM; 
     885        } 
    882886#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,1)) 
    883887        i2c_proc_header->ctl_table->child->de->owner = THIS_MODULE; 
  • i2c/trunk/mkpatch/Config.in

    r3588 r3613  
    4040   dep_tristate 'I2C device interface' CONFIG_I2C_CHARDEV $CONFIG_I2C 
    4141 
    42    dep_tristate 'I2C /proc interface (required for hardware sensors)' CONFIG_I2C_PROC $CONFIG_I2C 
     42   dep_tristate 'I2C /proc interface (required for hardware sensors)' CONFIG_I2C_PROC $CONFIG_I2C $CONFIG_SYSCTL 
    4343 
    4444fi