提交 152ec33b 编写于 作者: M Moritz Fischer 提交者: Yang Yingliang

net: phy: fixed_phy: Fix fixed_phy not checking GPIO

stable inclusion
from linux-4.19.99
commit 57738dd2709835fc45682afa0885a870d62ca51e

--------------------------------

[ Upstream commit 8f289805 ]

Fix fixed_phy not checking GPIO if no link_update callback
is registered.

In the original version all users registered a link_update
callback so the issue was masked.

Fixes: a5597008 ("phy: fixed_phy: Add gpio to determine link up/down.")
Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
Signed-off-by: NMoritz Fischer <mdf@kernel.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 cdc8a64a
......@@ -67,11 +67,11 @@ static int fixed_mdio_read(struct mii_bus *bus, int phy_addr, int reg_num)
do {
s = read_seqcount_begin(&fp->seqcount);
/* Issue callback if user registered it. */
if (fp->link_update) {
if (fp->link_update)
fp->link_update(fp->phydev->attached_dev,
&fp->status);
/* Check the GPIO for change in status */
fixed_phy_update(fp);
}
state = fp->status;
} while (read_seqcount_retry(&fp->seqcount, s));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册