提交 9fe99de0 编写于 作者: Y Yang Yingliang 提交者: Jakub Kicinski

net: dsa: qca8k: add missing check return value in qca8k_phylink_mac_config()

Now we can check qca8k_read() return value correctly, so if
it fails, we need return directly.
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NJakub Kicinski <kuba@kernel.org>
上级 7c9896e3
...@@ -1128,6 +1128,7 @@ qca8k_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode, ...@@ -1128,6 +1128,7 @@ qca8k_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
{ {
struct qca8k_priv *priv = ds->priv; struct qca8k_priv *priv = ds->priv;
u32 reg, val; u32 reg, val;
int ret;
switch (port) { switch (port) {
case 0: /* 1st CPU port */ case 0: /* 1st CPU port */
...@@ -1198,7 +1199,9 @@ qca8k_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode, ...@@ -1198,7 +1199,9 @@ qca8k_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
qca8k_write(priv, reg, QCA8K_PORT_PAD_SGMII_EN); qca8k_write(priv, reg, QCA8K_PORT_PAD_SGMII_EN);
/* Enable/disable SerDes auto-negotiation as necessary */ /* Enable/disable SerDes auto-negotiation as necessary */
qca8k_read(priv, QCA8K_REG_PWS, &val); ret = qca8k_read(priv, QCA8K_REG_PWS, &val);
if (ret)
return;
if (phylink_autoneg_inband(mode)) if (phylink_autoneg_inband(mode))
val &= ~QCA8K_PWS_SERDES_AEN_DIS; val &= ~QCA8K_PWS_SERDES_AEN_DIS;
else else
...@@ -1206,7 +1209,9 @@ qca8k_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode, ...@@ -1206,7 +1209,9 @@ qca8k_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
qca8k_write(priv, QCA8K_REG_PWS, val); qca8k_write(priv, QCA8K_REG_PWS, val);
/* Configure the SGMII parameters */ /* Configure the SGMII parameters */
qca8k_read(priv, QCA8K_REG_SGMII_CTRL, &val); ret = qca8k_read(priv, QCA8K_REG_SGMII_CTRL, &val);
if (ret)
return;
val |= QCA8K_SGMII_EN_PLL | QCA8K_SGMII_EN_RX | val |= QCA8K_SGMII_EN_PLL | QCA8K_SGMII_EN_RX |
QCA8K_SGMII_EN_TX | QCA8K_SGMII_EN_SD; QCA8K_SGMII_EN_TX | QCA8K_SGMII_EN_SD;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册