Skip to content

Commit 0a9d6a3

Browse files
Hans ZhangMani-Sadhasivam
authored andcommitted
PCI: mobiveil: Return bool from link up check
PCIe link status check is supposed to return a boolean to indicate whether the link is up or not. So update ls_g4_pcie_link_up() to return bool and also simplify the LTSSM state check. Signed-off-by: Hans Zhang <[email protected]> [mani: commit message rewording] Signed-off-by: Manivannan Sadhasivam <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Reviewed-by: Niklas Cassel <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent f46bfb1 commit 0a9d6a3

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,13 @@ static inline void ls_g4_pcie_pf_writel(struct ls_g4_pcie *pcie,
5353
iowrite32(val, pcie->pci.csr_axi_slave_base + PCIE_PF_OFF + off);
5454
}
5555

56-
static int ls_g4_pcie_link_up(struct mobiveil_pcie *pci)
56+
static bool ls_g4_pcie_link_up(struct mobiveil_pcie *pci)
5757
{
5858
struct ls_g4_pcie *pcie = to_ls_g4_pcie(pci);
5959
u32 state;
6060

6161
state = ls_g4_pcie_pf_readl(pcie, PCIE_PF_DBG);
62-
state = state & PF_DBG_LTSSM_MASK;
63-
64-
if (state == PF_DBG_LTSSM_L0)
65-
return 1;
66-
67-
return 0;
62+
return (state & PF_DBG_LTSSM_MASK) == PF_DBG_LTSSM_L0;
6863
}
6964

7065
static void ls_g4_pcie_disable_interrupt(struct ls_g4_pcie *pcie)

drivers/pci/controller/mobiveil/pcie-mobiveil.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ struct mobiveil_root_port {
160160
};
161161

162162
struct mobiveil_pab_ops {
163-
int (*link_up)(struct mobiveil_pcie *pcie);
163+
bool (*link_up)(struct mobiveil_pcie *pcie);
164164
};
165165

166166
struct mobiveil_pcie {

0 commit comments

Comments
 (0)