diff options
author | Lukas Wunner <lukas@wunner.de> | 2016-03-20 08:57:20 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2016-04-08 12:09:34 -0400 |
commit | aae20bb6b45e0666c63506053c40f71c0c34cba0 (patch) | |
tree | ebbc7dbfa484881270e453ff5fbdd73af67a897f | |
parent | 1d111406c6d91f4d7f6cc69a43e59546e8010aae (diff) |
thunderbolt: Fix typos and magic number
Fix typo in tb_cfg_print_error() message. Fix bytecount in struct
tb_drom_entry_port comment. Replace magic number in tb_switch_alloc().
Rename tb_sw_set_unpplugged() and TB_CAL_IECS to fix typos.
[bhelgaas: no functional change intended]
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Andreas Noever <andreas.noever@gmail.com>
-rw-r--r-- | drivers/thunderbolt/ctl.c | 2 | ||||
-rw-r--r-- | drivers/thunderbolt/eeprom.c | 2 | ||||
-rw-r--r-- | drivers/thunderbolt/switch.c | 10 | ||||
-rw-r--r-- | drivers/thunderbolt/tb.c | 2 | ||||
-rw-r--r-- | drivers/thunderbolt/tb.h | 2 | ||||
-rw-r--r-- | drivers/thunderbolt/tb_regs.h | 2 |
6 files changed, 10 insertions, 10 deletions
diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c index 799634b382c6..1146ff4210a9 100644 --- a/drivers/thunderbolt/ctl.c +++ b/drivers/thunderbolt/ctl.c | |||
@@ -249,7 +249,7 @@ static void tb_cfg_print_error(struct tb_ctl *ctl, | |||
249 | * cfg_read/cfg_write. | 249 | * cfg_read/cfg_write. |
250 | */ | 250 | */ |
251 | tb_ctl_WARN(ctl, | 251 | tb_ctl_WARN(ctl, |
252 | "CFG_ERROR(%llx:%x): Invalid config space of offset\n", | 252 | "CFG_ERROR(%llx:%x): Invalid config space or offset\n", |
253 | res->response_route, res->response_port); | 253 | res->response_route, res->response_port); |
254 | return; | 254 | return; |
255 | case TB_CFG_ERROR_NO_SUCH_PORT: | 255 | case TB_CFG_ERROR_NO_SUCH_PORT: |
diff --git a/drivers/thunderbolt/eeprom.c b/drivers/thunderbolt/eeprom.c index 0dde34e3a7c5..47e56e861d61 100644 --- a/drivers/thunderbolt/eeprom.c +++ b/drivers/thunderbolt/eeprom.c | |||
@@ -221,7 +221,7 @@ struct tb_drom_entry_port { | |||
221 | u8 micro1:4; | 221 | u8 micro1:4; |
222 | u8 micro3; | 222 | u8 micro3; |
223 | 223 | ||
224 | /* BYTES 5-6, TODO: verify (find hardware that has these set) */ | 224 | /* BYTES 6-7, TODO: verify (find hardware that has these set) */ |
225 | u8 peer_port_rid:4; | 225 | u8 peer_port_rid:4; |
226 | u8 unknown3:3; | 226 | u8 unknown3:3; |
227 | bool has_peer_port:1; | 227 | bool has_peer_port:1; |
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c index db73ffed68a9..c6270f0bd5c5 100644 --- a/drivers/thunderbolt/switch.c +++ b/drivers/thunderbolt/switch.c | |||
@@ -350,7 +350,7 @@ struct tb_switch *tb_switch_alloc(struct tb *tb, u64 route) | |||
350 | return NULL; | 350 | return NULL; |
351 | 351 | ||
352 | sw->tb = tb; | 352 | sw->tb = tb; |
353 | if (tb_cfg_read(tb->ctl, &sw->config, route, 0, 2, 0, 5)) | 353 | if (tb_cfg_read(tb->ctl, &sw->config, route, 0, TB_CFG_SWITCH, 0, 5)) |
354 | goto err; | 354 | goto err; |
355 | tb_info(tb, | 355 | tb_info(tb, |
356 | "initializing Switch at %#llx (depth: %d, up port: %d)\n", | 356 | "initializing Switch at %#llx (depth: %d, up port: %d)\n", |
@@ -426,9 +426,9 @@ err: | |||
426 | } | 426 | } |
427 | 427 | ||
428 | /** | 428 | /** |
429 | * tb_sw_set_unpplugged() - set is_unplugged on switch and downstream switches | 429 | * tb_sw_set_unplugged() - set is_unplugged on switch and downstream switches |
430 | */ | 430 | */ |
431 | void tb_sw_set_unpplugged(struct tb_switch *sw) | 431 | void tb_sw_set_unplugged(struct tb_switch *sw) |
432 | { | 432 | { |
433 | int i; | 433 | int i; |
434 | if (sw == sw->tb->root_switch) { | 434 | if (sw == sw->tb->root_switch) { |
@@ -442,7 +442,7 @@ void tb_sw_set_unpplugged(struct tb_switch *sw) | |||
442 | sw->is_unplugged = true; | 442 | sw->is_unplugged = true; |
443 | for (i = 0; i <= sw->config.max_port_number; i++) { | 443 | for (i = 0; i <= sw->config.max_port_number; i++) { |
444 | if (!tb_is_upstream_port(&sw->ports[i]) && sw->ports[i].remote) | 444 | if (!tb_is_upstream_port(&sw->ports[i]) && sw->ports[i].remote) |
445 | tb_sw_set_unpplugged(sw->ports[i].remote->sw); | 445 | tb_sw_set_unplugged(sw->ports[i].remote->sw); |
446 | } | 446 | } |
447 | } | 447 | } |
448 | 448 | ||
@@ -484,7 +484,7 @@ int tb_switch_resume(struct tb_switch *sw) | |||
484 | || tb_switch_resume(port->remote->sw)) { | 484 | || tb_switch_resume(port->remote->sw)) { |
485 | tb_port_warn(port, | 485 | tb_port_warn(port, |
486 | "lost during suspend, disconnecting\n"); | 486 | "lost during suspend, disconnecting\n"); |
487 | tb_sw_set_unpplugged(port->remote->sw); | 487 | tb_sw_set_unplugged(port->remote->sw); |
488 | } | 488 | } |
489 | } | 489 | } |
490 | return 0; | 490 | return 0; |
diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c index d2c3fe346e91..24b6d30c3c86 100644 --- a/drivers/thunderbolt/tb.c +++ b/drivers/thunderbolt/tb.c | |||
@@ -246,7 +246,7 @@ static void tb_handle_hotplug(struct work_struct *work) | |||
246 | if (ev->unplug) { | 246 | if (ev->unplug) { |
247 | if (port->remote) { | 247 | if (port->remote) { |
248 | tb_port_info(port, "unplugged\n"); | 248 | tb_port_info(port, "unplugged\n"); |
249 | tb_sw_set_unpplugged(port->remote->sw); | 249 | tb_sw_set_unplugged(port->remote->sw); |
250 | tb_free_invalid_tunnels(tb); | 250 | tb_free_invalid_tunnels(tb); |
251 | tb_switch_free(port->remote->sw); | 251 | tb_switch_free(port->remote->sw); |
252 | port->remote = NULL; | 252 | port->remote = NULL; |
diff --git a/drivers/thunderbolt/tb.h b/drivers/thunderbolt/tb.h index 8b0d7cf2b6d6..61d57ba64035 100644 --- a/drivers/thunderbolt/tb.h +++ b/drivers/thunderbolt/tb.h | |||
@@ -226,7 +226,7 @@ void tb_switch_free(struct tb_switch *sw); | |||
226 | void tb_switch_suspend(struct tb_switch *sw); | 226 | void tb_switch_suspend(struct tb_switch *sw); |
227 | int tb_switch_resume(struct tb_switch *sw); | 227 | int tb_switch_resume(struct tb_switch *sw); |
228 | int tb_switch_reset(struct tb *tb, u64 route); | 228 | int tb_switch_reset(struct tb *tb, u64 route); |
229 | void tb_sw_set_unpplugged(struct tb_switch *sw); | 229 | void tb_sw_set_unplugged(struct tb_switch *sw); |
230 | struct tb_switch *get_switch_at_route(struct tb_switch *sw, u64 route); | 230 | struct tb_switch *get_switch_at_route(struct tb_switch *sw, u64 route); |
231 | 231 | ||
232 | int tb_wait_for_port(struct tb_port *port, bool wait_if_unplugged); | 232 | int tb_wait_for_port(struct tb_port *port, bool wait_if_unplugged); |
diff --git a/drivers/thunderbolt/tb_regs.h b/drivers/thunderbolt/tb_regs.h index 6577af75d9dc..1e2a4a8046be 100644 --- a/drivers/thunderbolt/tb_regs.h +++ b/drivers/thunderbolt/tb_regs.h | |||
@@ -30,7 +30,7 @@ enum tb_cap { | |||
30 | TB_CAP_I2C = 0x0005, | 30 | TB_CAP_I2C = 0x0005, |
31 | TB_CAP_PLUG_EVENTS = 0x0105, /* also EEPROM */ | 31 | TB_CAP_PLUG_EVENTS = 0x0105, /* also EEPROM */ |
32 | TB_CAP_TIME2 = 0x0305, | 32 | TB_CAP_TIME2 = 0x0305, |
33 | TB_CAL_IECS = 0x0405, | 33 | TB_CAP_IECS = 0x0405, |
34 | TB_CAP_LINK_CONTROLLER = 0x0605, /* also IECS */ | 34 | TB_CAP_LINK_CONTROLLER = 0x0605, /* also IECS */ |
35 | }; | 35 | }; |
36 | 36 | ||