Skip to content

Commit

Permalink
Revert "thunderbolt: Hide authorized attribute if router does not sup…
Browse files Browse the repository at this point in the history
…port PCIe tunnels"

This reverts commit 6f3bade.
  • Loading branch information
jackpot51 committed Sep 10, 2021
1 parent 5b892ca commit cefa1b4
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions drivers/thunderbolt/switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -1740,18 +1740,6 @@ static struct attribute *switch_attrs[] = {
NULL,
};

static bool has_port(const struct tb_switch *sw, enum tb_port_type type)
{
const struct tb_port *port;

tb_switch_for_each_port(sw, port) {
if (!port->disabled && port->config.type == type)
return true;
}

return false;
}

static umode_t switch_attr_is_visible(struct kobject *kobj,
struct attribute *attr, int n)
{
Expand All @@ -1760,8 +1748,7 @@ static umode_t switch_attr_is_visible(struct kobject *kobj,

if (attr == &dev_attr_authorized.attr) {
if (sw->tb->security_level == TB_SECURITY_NOPCIE ||
sw->tb->security_level == TB_SECURITY_DPONLY ||
!has_port(sw, TB_TYPE_PCIE_UP))
sw->tb->security_level == TB_SECURITY_DPONLY)
return 0;
} else if (attr == &dev_attr_device.attr) {
if (!sw->device)
Expand Down

0 comments on commit cefa1b4

Please sign in to comment.