OSDN Git Service

thunderbolt: Expand controller name in tb_switch_is_xy()
authorMika Westerberg <mika.westerberg@linux.intel.com>
Tue, 8 Oct 2019 13:42:47 +0000 (16:42 +0300)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Sat, 2 Nov 2019 09:13:31 +0000 (12:13 +0300)
For a casual reader tb_switch_is_cr() does not tell much so instead
spell out the full controller name in the function name. For example
tb_switch_is_cr() becomes tb_switch_is_cactus_ridge() which is easier
to understand.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/thunderbolt/cap.c
drivers/thunderbolt/tb.c
drivers/thunderbolt/tb.h

index 8bf8e03..fdd77bb 100644 (file)
@@ -33,9 +33,9 @@ static int tb_port_enable_tmu(struct tb_port *port, bool enable)
         * Legacy devices need to have TMU access enabled before port
         * space can be fully accessed.
         */
-       if (tb_switch_is_lr(sw))
+       if (tb_switch_is_light_ridge(sw))
                offset = 0x26;
-       else if (tb_switch_is_er(sw))
+       else if (tb_switch_is_eagle_ridge(sw))
                offset = 0x2a;
        else
                return 0;
@@ -60,7 +60,7 @@ static void tb_port_dummy_read(struct tb_port *port)
         * reading stale data on next read perform one dummy read after
         * port capabilities are walked.
         */
-       if (tb_switch_is_lr(port->sw)) {
+       if (tb_switch_is_light_ridge(port->sw)) {
                u32 dummy;
 
                tb_port_read(port, &dummy, TB_CFG_PORT, 0, 1);
index f2ce6ad..e8e2d20 100644 (file)
@@ -342,9 +342,9 @@ static struct tb_port *tb_find_pcie_down(struct tb_switch *sw,
                 * Hard-coded Thunderbolt port to PCIe down port mapping
                 * per controller.
                 */
-               if (tb_switch_is_cr(sw))
+               if (tb_switch_is_cactus_ridge(sw))
                        index = !phy_port ? 6 : 7;
-               else if (tb_switch_is_fr(sw))
+               else if (tb_switch_is_falcon_ridge(sw))
                        index = !phy_port ? 6 : 8;
                else
                        goto out;
index 16d5299..a6f1fa0 100644 (file)
@@ -576,17 +576,17 @@ static inline struct tb_switch *tb_switch_parent(struct tb_switch *sw)
        return tb_to_switch(sw->dev.parent);
 }
 
-static inline bool tb_switch_is_lr(const struct tb_switch *sw)
+static inline bool tb_switch_is_light_ridge(const struct tb_switch *sw)
 {
        return sw->config.device_id == PCI_DEVICE_ID_INTEL_LIGHT_RIDGE;
 }
 
-static inline bool tb_switch_is_er(const struct tb_switch *sw)
+static inline bool tb_switch_is_eagle_ridge(const struct tb_switch *sw)
 {
        return sw->config.device_id == PCI_DEVICE_ID_INTEL_EAGLE_RIDGE;
 }
 
-static inline bool tb_switch_is_cr(const struct tb_switch *sw)
+static inline bool tb_switch_is_cactus_ridge(const struct tb_switch *sw)
 {
        switch (sw->config.device_id) {
        case PCI_DEVICE_ID_INTEL_CACTUS_RIDGE_2C:
@@ -597,7 +597,7 @@ static inline bool tb_switch_is_cr(const struct tb_switch *sw)
        }
 }
 
-static inline bool tb_switch_is_fr(const struct tb_switch *sw)
+static inline bool tb_switch_is_falcon_ridge(const struct tb_switch *sw)
 {
        switch (sw->config.device_id) {
        case PCI_DEVICE_ID_INTEL_FALCON_RIDGE_2C_BRIDGE: