Linux 防止I2C设备两次配置为从设备
我一直在使用Wolfram Sang的I2C从机代码将linux(designware)设备驱动程序配置为I2C从机。 它一直在工作,但是我考虑下面的“bug”:我想知道I2C设备没有被配置为从设备两次。所以当有人尝试这样做时,我让i2c_slave_寄存器返回a-EBUSY。但是,这并不妨碍I2C内核注册客户端Linux 防止I2C设备两次配置为从设备,linux,kernel,driver,i2c,slave,Linux,Kernel,Driver,I2c,Slave,我一直在使用Wolfram Sang的I2C从机代码将linux(designware)设备驱动程序配置为I2C从机。 它一直在工作,但是我考虑下面的“bug”:我想知道I2C设备没有被配置为从设备两次。所以当有人尝试这样做时,我让i2c_slave_寄存器返回a-EBUSY。但是,这并不妨碍I2C内核注册客户端 i2c-slave-eeprom 0-1063: probe i2c_designware ffc04000.i2c: adapter already configured as sl
i2c-slave-eeprom 0-1063: probe
i2c_designware ffc04000.i2c: adapter already configured as slave
i2c-slave-eeprom 0-1063: i2c_slave_register: adapter returned error -16
i2c-slave-eeprom: probe of 0-1063 failed with error -16
i2c i2c-0: client [slave-24c02] registered with bus id 0-1063
i2c i2c-0: new_device: Instantiated device slave-24c02 at 0x63
我发现这个问题是由really_probe和driver_probe_设备(dd.c)的实现引起的。即使发生错误,两个函数都返回0!
这似乎是一个特定的选择(例如,请参阅)。。。但是,我应该如何阻止core注册这个客户端呢?(或者我不应该?)