提交 22f6bba7 编写于 作者: S Shaohui Xie 提交者: David S. Miller

net/fsl: Replace spin_event_timeout() with arch independent in xgmac_mdio

spin_event_timeout() is PPC dependent, use an arch independent
equivalent instead.
Signed-off-by: NShaohui Xie <Shaohui.Xie@freescale.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ca43e58c
...@@ -52,12 +52,16 @@ struct tgec_mdio_controller { ...@@ -52,12 +52,16 @@ struct tgec_mdio_controller {
static int xgmac_wait_until_free(struct device *dev, static int xgmac_wait_until_free(struct device *dev,
struct tgec_mdio_controller __iomem *regs) struct tgec_mdio_controller __iomem *regs)
{ {
uint32_t status; unsigned int timeout;
/* Wait till the bus is free */ /* Wait till the bus is free */
status = spin_event_timeout( timeout = TIMEOUT;
!((ioread32be(&regs->mdio_stat)) & MDIO_STAT_BSY), TIMEOUT, 0); while ((ioread32be(&regs->mdio_stat) & MDIO_STAT_BSY) && timeout) {
if (!status) { cpu_relax();
timeout--;
}
if (!timeout) {
dev_err(dev, "timeout waiting for bus to be free\n"); dev_err(dev, "timeout waiting for bus to be free\n");
return -ETIMEDOUT; return -ETIMEDOUT;
} }
...@@ -71,12 +75,16 @@ static int xgmac_wait_until_free(struct device *dev, ...@@ -71,12 +75,16 @@ static int xgmac_wait_until_free(struct device *dev,
static int xgmac_wait_until_done(struct device *dev, static int xgmac_wait_until_done(struct device *dev,
struct tgec_mdio_controller __iomem *regs) struct tgec_mdio_controller __iomem *regs)
{ {
uint32_t status; unsigned int timeout;
/* Wait till the MDIO write is complete */ /* Wait till the MDIO write is complete */
status = spin_event_timeout( timeout = TIMEOUT;
!((ioread32be(&regs->mdio_data)) & MDIO_DATA_BSY), TIMEOUT, 0); while ((ioread32be(&regs->mdio_data) & MDIO_DATA_BSY) && timeout) {
if (!status) { cpu_relax();
timeout--;
}
if (!timeout) {
dev_err(dev, "timeout waiting for operation to complete\n"); dev_err(dev, "timeout waiting for operation to complete\n");
return -ETIMEDOUT; return -ETIMEDOUT;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册