return 0;
 }
 
+/**
+ * tb_eeprom_get_drom_offset - get drom offset within eeprom
+ */
+static int tb_eeprom_get_drom_offset(struct tb_switch *sw, u16 *offset)
+{
+       struct tb_cap_plug_events cap;
+       int res;
+
+       if (!sw->cap_plug_events) {
+               tb_sw_warn(sw, "no TB_CAP_PLUG_EVENTS, cannot read eeprom\n");
+               return -ENODEV;
+       }
+       res = tb_sw_read(sw, &cap, TB_CFG_SWITCH, sw->cap_plug_events,
+                            sizeof(cap) / 4);
+       if (res)
+               return res;
+
+       if (!cap.eeprom_ctl.present || cap.eeprom_ctl.not_present) {
+               tb_sw_warn(sw, "no NVM\n");
+               return -ENODEV;
+       }
+
+       if (cap.drom_offset > 0xffff) {
+               tb_sw_warn(sw, "drom offset is larger than 0xffff: %#x\n",
+                               cap.drom_offset);
+               return -ENXIO;
+       }
+       *offset = cap.drom_offset;
+       return 0;
+}
+
 /**
  * tb_eeprom_read_n - read count bytes from offset into val
  */
 static int tb_eeprom_read_n(struct tb_switch *sw, u16 offset, u8 *val,
                size_t count)
 {
+       u16 drom_offset;
        int i, res;
+
+       res = tb_eeprom_get_drom_offset(sw, &drom_offset);
+       if (res)
+               return res;
+
+       offset += drom_offset;
+
        res = tb_eeprom_active(sw, true);
        if (res)
                return res;
 } __packed;
 
 
-/**
- * tb_eeprom_get_drom_offset - get drom offset within eeprom
- */
-static int tb_eeprom_get_drom_offset(struct tb_switch *sw, u16 *offset)
-{
-       struct tb_cap_plug_events cap;
-       int res;
-       if (!sw->cap_plug_events) {
-               tb_sw_warn(sw, "no TB_CAP_PLUG_EVENTS, cannot read eeprom\n");
-               return -ENOSYS;
-       }
-       res = tb_sw_read(sw, &cap, TB_CFG_SWITCH, sw->cap_plug_events,
-                            sizeof(cap) / 4);
-       if (res)
-               return res;
-
-       if (!cap.eeprom_ctl.present || cap.eeprom_ctl.not_present) {
-               tb_sw_warn(sw, "no NVM\n");
-               return -ENOSYS;
-       }
-
-       if (cap.drom_offset > 0xffff) {
-               tb_sw_warn(sw, "drom offset is larger than 0xffff: %#x\n",
-                               cap.drom_offset);
-               return -ENXIO;
-       }
-       *offset = cap.drom_offset;
-       return 0;
-}
-
 /**
  * tb_drom_read_uid_only - read uid directly from drom
  *
 int tb_drom_read_uid_only(struct tb_switch *sw, u64 *uid)
 {
        u8 data[9];
-       u16 drom_offset;
        u8 crc;
-       int res = tb_eeprom_get_drom_offset(sw, &drom_offset);
-       if (res)
-               return res;
-
-       if (drom_offset == 0)
-               return -ENODEV;
+       int res;
 
        /* read uid */
-       res = tb_eeprom_read_n(sw, drom_offset, data, 9);
+       res = tb_eeprom_read_n(sw, 0, data, 9);
        if (res)
                return res;
 
  */
 int tb_drom_read(struct tb_switch *sw)
 {
-       u16 drom_offset;
        u16 size;
        u32 crc;
        struct tb_drom_header *header;
                return 0;
        }
 
-       res = tb_eeprom_get_drom_offset(sw, &drom_offset);
-       if (res)
-               return res;
-
-       res = tb_eeprom_read_n(sw, drom_offset + 14, (u8 *) &size, 2);
+       res = tb_eeprom_read_n(sw, 14, (u8 *) &size, 2);
        if (res)
                return res;
        size &= 0x3ff;
        sw->drom = kzalloc(size, GFP_KERNEL);
        if (!sw->drom)
                return -ENOMEM;
-       res = tb_eeprom_read_n(sw, drom_offset, sw->drom, size);
+       res = tb_eeprom_read_n(sw, 0, sw->drom, size);
        if (res)
                goto err;