[PATCH v2 27/46] phy: rockchip: Fix not calling dev_err with a device
Kever Yang
kever.yang at rock-chips.com
Mon Sep 28 04:43:04 CEST 2020
On 2020/9/15 下午10:45, Sean Anderson wrote:
> Get the device from phy, or pass the phy in.
>
> Signed-off-by: Sean Anderson <seanga2 at gmail.com>
Reviewed-by: Kever Yang <kever.yang at rock-chips.com>
Thanks,
- Kever
> ---
>
> Changes in v2:
> - New
>
> drivers/phy/rockchip/phy-rockchip-pcie.c | 14 +++++++-------
> drivers/phy/rockchip/phy-rockchip-typec.c | 6 +++---
> 2 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/phy/rockchip/phy-rockchip-pcie.c b/drivers/phy/rockchip/phy-rockchip-pcie.c
> index 83928cffe0..617943fd82 100644
> --- a/drivers/phy/rockchip/phy-rockchip-pcie.c
> +++ b/drivers/phy/rockchip/phy-rockchip-pcie.c
> @@ -98,7 +98,7 @@ static int rockchip_pcie_phy_power_on(struct phy *phy)
>
> ret = reset_deassert(&priv->phy_rst);
> if (ret) {
> - dev_err(dev, "failed to assert phy reset\n");
> + dev_err(phy->dev, "failed to assert phy reset\n");
> return ret;
> }
>
> @@ -119,7 +119,7 @@ static int rockchip_pcie_phy_power_on(struct phy *phy)
> 20 * 1000,
> 50);
> if (ret) {
> - dev_err(&priv->dev, "pll lock timeout!\n");
> + dev_err(phy->dev, "pll lock timeout!\n");
> goto err_pll_lock;
> }
>
> @@ -133,7 +133,7 @@ static int rockchip_pcie_phy_power_on(struct phy *phy)
> 20 * 1000,
> 50);
> if (ret) {
> - dev_err(&priv->dev, "pll output enable timeout!\n");
> + dev_err(phy->dev, "pll output enable timeout!\n");
> goto err_pll_lock;
> }
>
> @@ -149,7 +149,7 @@ static int rockchip_pcie_phy_power_on(struct phy *phy)
> 20 * 1000,
> 50);
> if (ret) {
> - dev_err(&priv->dev, "pll relock timeout!\n");
> + dev_err(phy->dev, "pll relock timeout!\n");
> goto err_pll_lock;
> }
>
> @@ -173,7 +173,7 @@ static int rockchip_pcie_phy_power_off(struct phy *phy)
>
> ret = reset_assert(&priv->phy_rst);
> if (ret) {
> - dev_err(dev, "failed to assert phy reset\n");
> + dev_err(phy->dev, "failed to assert phy reset\n");
> return ret;
> }
>
> @@ -187,13 +187,13 @@ static int rockchip_pcie_phy_init(struct phy *phy)
>
> ret = clk_enable(&priv->refclk);
> if (ret) {
> - dev_err(dev, "failed to enable refclk clock\n");
> + dev_err(phy->dev, "failed to enable refclk clock\n");
> return ret;
> }
>
> ret = reset_assert(&priv->phy_rst);
> if (ret) {
> - dev_err(dev, "failed to assert phy reset\n");
> + dev_err(phy->dev, "failed to assert phy reset\n");
> goto err_reset;
> }
>
> diff --git a/drivers/phy/rockchip/phy-rockchip-typec.c b/drivers/phy/rockchip/phy-rockchip-typec.c
> index c9c8e1c542..da00daa447 100644
> --- a/drivers/phy/rockchip/phy-rockchip-typec.c
> +++ b/drivers/phy/rockchip/phy-rockchip-typec.c
> @@ -448,7 +448,7 @@ static void rockchip_tcphy_rx_usb3_cfg_lane(struct rockchip_tcphy *priv,
> writel(0xfb, priv->reg_base + XCVR_DIAG_BIDI_CTRL(lane));
> }
>
> -static int rockchip_tcphy_init(struct rockchip_tcphy *priv)
> +static int rockchip_tcphy_init(struct phy *phy, struct rockchip_tcphy *priv)
> {
> const struct rockchip_usb3phy_port_cfg *cfg = priv->port_cfgs;
> u32 val;
> @@ -559,9 +559,9 @@ static int rockchip_usb3_phy_power_on(struct phy *phy)
> return 0;
>
> if (priv->mode == MODE_DISCONNECT) {
> - ret = rockchip_tcphy_init(priv);
> + ret = rockchip_tcphy_init(phy, priv);
> if (ret) {
> - dev_err(dev, "failed to init tcphy (ret=%d)\n", ret);
> + dev_err(phy->dev, "failed to init tcphy (ret=%d)\n", ret);
> return ret;
> }
> }
More information about the U-Boot
mailing list