aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/controller/dwc/pcie-kirin.c
diff options
context:
space:
mode:
authorHans Zhang <[email protected]>2025-05-10 16:07:08 +0000
committerManivannan Sadhasivam <[email protected]>2025-05-13 09:12:59 +0000
commitf46bfb1d3c6a601caad90eb3c11a1e1e17cccb1a (patch)
treec4e059220b319d991a827ef4791dbfa7ed1d89f4 /drivers/pci/controller/dwc/pcie-kirin.c
parentPCI: dw-rockchip: Fix PHY function call sequence in rockchip_pcie_phy_deinit() (diff)
downloadkernel-f46bfb1d3c6a601caad90eb3c11a1e1e17cccb1a.tar.gz
kernel-f46bfb1d3c6a601caad90eb3c11a1e1e17cccb1a.zip
PCI: dwc: 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, modify the link_up callbacks and dw_pcie_link_up() function to return bool instead of int. Signed-off-by: Hans Zhang <[email protected]> [mani: commit message reword] 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]
Diffstat (limited to 'drivers/pci/controller/dwc/pcie-kirin.c')
-rw-r--r--drivers/pci/controller/dwc/pcie-kirin.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/pci/controller/dwc/pcie-kirin.c b/drivers/pci/controller/dwc/pcie-kirin.c
index d0e6a3811b00..91559c8b1866 100644
--- a/drivers/pci/controller/dwc/pcie-kirin.c
+++ b/drivers/pci/controller/dwc/pcie-kirin.c
@@ -586,16 +586,13 @@ static void kirin_pcie_write_dbi(struct dw_pcie *pci, void __iomem *base,
kirin_pcie_sideband_dbi_w_mode(kirin_pcie, false);
}
-static int kirin_pcie_link_up(struct dw_pcie *pci)
+static bool kirin_pcie_link_up(struct dw_pcie *pci)
{
struct kirin_pcie *kirin_pcie = to_kirin_pcie(pci);
u32 val;
regmap_read(kirin_pcie->apb, PCIE_APB_PHY_STATUS0, &val);
- if ((val & PCIE_LINKUP_ENABLE) == PCIE_LINKUP_ENABLE)
- return 1;
-
- return 0;
+ return (val & PCIE_LINKUP_ENABLE) == PCIE_LINKUP_ENABLE;
}
static int kirin_pcie_start_link(struct dw_pcie *pci)