Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

phy: qcom-qmp-ufs: Remove qmp_ufs_com_init()

The qmp_ufs_power_on() function acts as a wrapper, solely invoking
qmp_ufs_com_init(). Additionally, the code within qmp_ufs_com_init()
does not correspond well with its name.

Therefore, to enhance the readability and eliminate unnecessary
function call inline qmp_ufs_com_init() into qmp_ufs_power_on().

There is no change to the functionality.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Nitin Rawat <quic_nitirawa@quicinc.com>
Link: https://lore.kernel.org/r/20250526153821.7918-7-quic_nitirawa@quicinc.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Nitin Rawat and committed by
Vinod Koul
7bcf4936 d58b9ff4

+17 -28
+17 -28
drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
··· 1758 1758 qmp_ufs_init_all(qmp, &cfg->tbls_hs_b); 1759 1759 } 1760 1760 1761 - static int qmp_ufs_com_init(struct qmp_ufs *qmp) 1762 - { 1763 - const struct qmp_phy_cfg *cfg = qmp->cfg; 1764 - void __iomem *pcs = qmp->pcs; 1765 - int ret; 1766 - 1767 - ret = regulator_bulk_enable(cfg->num_vregs, qmp->vregs); 1768 - if (ret) { 1769 - dev_err(qmp->dev, "failed to enable regulators, err=%d\n", ret); 1770 - return ret; 1771 - } 1772 - 1773 - ret = clk_bulk_prepare_enable(qmp->num_clks, qmp->clks); 1774 - if (ret) 1775 - goto err_disable_regulators; 1776 - 1777 - qphy_setbits(pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], SW_PWRDN); 1778 - 1779 - return 0; 1780 - 1781 - err_disable_regulators: 1782 - regulator_bulk_disable(cfg->num_vregs, qmp->vregs); 1783 - 1784 - return ret; 1785 - } 1786 - 1787 1761 static int qmp_ufs_com_exit(struct qmp_ufs *qmp) 1788 1762 { 1789 1763 const struct qmp_phy_cfg *cfg = qmp->cfg; ··· 1774 1800 static int qmp_ufs_power_on(struct phy *phy) 1775 1801 { 1776 1802 struct qmp_ufs *qmp = phy_get_drvdata(phy); 1803 + const struct qmp_phy_cfg *cfg = qmp->cfg; 1804 + void __iomem *pcs = qmp->pcs; 1777 1805 int ret; 1778 - dev_vdbg(qmp->dev, "Initializing QMP phy\n"); 1779 1806 1780 - ret = qmp_ufs_com_init(qmp); 1807 + ret = regulator_bulk_enable(cfg->num_vregs, qmp->vregs); 1808 + if (ret) { 1809 + dev_err(qmp->dev, "failed to enable regulators, err=%d\n", ret); 1810 + return ret; 1811 + } 1812 + 1813 + ret = clk_bulk_prepare_enable(qmp->num_clks, qmp->clks); 1814 + if (ret) 1815 + goto err_disable_regulators; 1816 + 1817 + qphy_setbits(pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], SW_PWRDN); 1818 + return 0; 1819 + 1820 + err_disable_regulators: 1821 + regulator_bulk_disable(cfg->num_vregs, qmp->vregs); 1781 1822 return ret; 1782 1823 } 1783 1824