summaryrefslogtreecommitdiffstats
path: root/drivers/thunderbolt
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2017-06-06 08:25:02 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-06-09 05:42:42 -0400
commitf53e7676046db175dc6ac78d429dd5077a9afbba (patch)
treef2f62f2e2cbaea12bd0f68832fe6d7c9983c5d06 /drivers/thunderbolt
parentbfe778ac49826ced3dceb6416038e1cd887ce2bd (diff)
thunderbolt: Fail switch adding operation if reading DROM fails
All non-root switches are expected to have DROM so if the operation fails, it might be due the user unlugging the device. There is no point continuing adding the switch further in that case. Just bail out. For root switches (hosts) the DROM is either retrieved from a EFI variable, NVM or hard-coded. 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/switch.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index 0475bfc6c208..2390f08b94da 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -535,8 +535,11 @@ int tb_switch_add(struct tb_switch *sw)
535 int i, ret; 535 int i, ret;
536 536
537 /* read drom */ 537 /* read drom */
538 if (tb_drom_read(sw)) 538 ret = tb_drom_read(sw);
539 tb_sw_warn(sw, "tb_eeprom_read_rom failed, continuing\n"); 539 if (ret) {
540 tb_sw_warn(sw, "tb_eeprom_read_rom failed\n");
541 return ret;
542 }
540 tb_sw_info(sw, "uid: %#llx\n", sw->uid); 543 tb_sw_info(sw, "uid: %#llx\n", sw->uid);
541 544
542 tb_switch_set_uuid(sw); 545 tb_switch_set_uuid(sw);