title: How can I dynamically remove or retrigger the probing an EEPROM via sysFS?
body: <p>I am wondering what the proper way is to remove EEPROMs dynamically.  An alternate approach that will also work is telling the device to re-do the probe.  I tried just echoing it to delete_device, but that gives an error that it can't find it in the device list.  I am running 4.14.149 kernel (built with Yocto Pyro).  The EEPROM in question is an Atmel 24CS02 (at24 compatible).</p>
  
  <p>This is kind of an odd use case; this is in a simulator with two i.MX6 based SOMs that is used for Continuous Integration, and there is no physical EEPROM, so the initial probe at boot time will fail.  This is why there is no eeprom file in the directory.  The EEPROM is simulated by an FPGA (that isn't loaded and configured until after the initial boot).  Once that is complete, I need to either re-probe (so that it will see an EEPROM there and populate the sysFS) or delete and re-add the device (which will re-trigger the probe). </p>
  
  <p>Here is the output from when I try to remove it:</p>
  
  <pre><code>root@PLX-23-UUT:~# cd /sys/bus/i2c/devices/
  root@PLX-23-UUT:/sys/bus/i2c/devices# ls
  2-0041  2-0050  2-0052  2-0056  2-0057  2-006f  i2c-1  i2c-2
  root@PLX-23-UUT:/sys/bus/i2c/devices# ls 2-0052
  modalias  name  of_node  subsystem  uevent
  root@PLX-23-UUT:/sys/bus/i2c/devices# echo 0x52 &gt; i2c-2/delete_device
  [   72.717009] i2c i2c-2: delete_device: Can't find device in list
  -sh: echo: write error: No such file or directory
  </code></pre>