thunderbolt: Call tb_eeprom_get_drom_offset() from tb_eeprom_read_n()
authorMika Westerberg <mika.westerberg@linux.intel.com>
Tue, 17 Dec 2019 12:33:38 +0000 (15:33 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Dec 2019 14:34:24 +0000 (15:34 +0100)
commit4deb200d34a779aa336ddcd213e39eb6104eb78a
treed4e446b1e18fcbb34a9aa7af775be700d655f82a
parent386e5e29d81cd088a1111277a18f13d571a6cea5
thunderbolt: Call tb_eeprom_get_drom_offset() from tb_eeprom_read_n()

We are going to re-use tb_drom_read() for USB4 DROM reading as well.
USB4 has separate router operations for this which does not need the
drom_offset. Therefore we move call to tb_eeprom_get_drom_offset() into
tb_eeprom_read_n() where it is needed.

While there change return -ENOSYS to -ENODEV because the former is only
supposed to be used with system calls (invalid syscall nr).

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Link: https://lore.kernel.org/r/20191217123345.31850-3-mika.westerberg@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/thunderbolt/eeprom.c