title: How to write to an EEPROM during Linux kernel reboot?
body: <p>I need to store a flag in an EEPROM based on the <code>arg</code> in <code>int reboot(int magic, int magic2, int cmd, void *arg);</code>. The eeprom is defined in my device tree like this:</p>
  
  <pre><code>eeprom2: eeprom@51 {
      compatible = "atmel,24c02";
      reg = &lt;0x51&gt;;
      pagesize = &lt;16&gt;;
  };
  </code></pre>
  
  <p>I can also read/write the eeprom via a sysfs file in userspace. That userspace write ultimately calls <code>at24.c:at24_write(struct at24_data *at24, const char *buf, loff_t off, size_t count)</code>. From my machine's restart() method under arch/arm, how can I get the pointer to the correct at24_data structure so I can call at24_write()?</p>