summaryrefslogtreecommitdiffstats
path: root/drivers/thunderbolt
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2017-06-06 08:24:55 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-06-09 05:42:41 -0400
commitdf1421b5f72979e48096f68c253f59aa7e8e7468 (patch)
tree5a456484095181ef3a2cb3bb0152b377fa707200 /drivers/thunderbolt
parent08a5e4cebec543bfa4a6d119fc18f0ed8fd9d8ce (diff)
thunderbolt: Do not try to read UID if DROM offset is read as 0
At least Falcon Ridge when in host mode does not have any kind of DROM available and reading DROM offset returns 0 for these. Do not try to read DROM any further in that case. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Yehezkel Bernat <yehezkel.bernat@intel.com> Reviewed-by: Michael Jamet <michael.jamet@intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Andreas Noever <andreas.noever@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/thunderbolt')
-rw-r--r--drivers/thunderbolt/eeprom.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/thunderbolt/eeprom.c b/drivers/thunderbolt/eeprom.c
index 6392990c984d..e4e64b130514 100644
--- a/drivers/thunderbolt/eeprom.c
+++ b/drivers/thunderbolt/eeprom.c
@@ -276,6 +276,9 @@ int tb_drom_read_uid_only(struct tb_switch *sw, u64 *uid)
276 if (res) 276 if (res)
277 return res; 277 return res;
278 278
279 if (drom_offset == 0)
280 return -ENODEV;
281
279 /* read uid */ 282 /* read uid */
280 res = tb_eeprom_read_n(sw, drom_offset, data, 9); 283 res = tb_eeprom_read_n(sw, drom_offset, data, 9);
281 if (res) 284 if (res)