summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Ténart2017-06-15 16:43:21 +0200
committerDavid S. Miller2017-06-16 18:27:11 +0200
commit1955796640a6736583b59c581d3ccddfca66cb33 (patch)
treef84cc54bf18613339cae0f2ae56f4b86f82d4084
parentnet: mvmdio: introduce an ops structure (diff)
downloadkernel-qcow2-linux-1955796640a6736583b59c581d3ccddfca66cb33.tar.gz
kernel-qcow2-linux-1955796640a6736583b59c581d3ccddfca66cb33.tar.xz
kernel-qcow2-linux-1955796640a6736583b59c581d3ccddfca66cb33.zip
net: mvmdio: put the poll intervals in the ops structure
Put the two poll intervals (min and max) in the driver's ops structure. This is needed to add the xmdio support later. Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/marvell/mvmdio.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/ethernet/marvell/mvmdio.c b/drivers/net/ethernet/marvell/mvmdio.c
index 2a8efc77f5fe..e4aa8e2d2e8a 100644
--- a/drivers/net/ethernet/marvell/mvmdio.c
+++ b/drivers/net/ethernet/marvell/mvmdio.c
@@ -64,6 +64,8 @@ struct orion_mdio_dev {
struct orion_mdio_ops {
int (*is_done)(struct orion_mdio_dev *);
+ unsigned int poll_interval_min;
+ unsigned int poll_interval_max;
};
/* Wait for the SMI unit to be ready for another operation
@@ -83,8 +85,8 @@ static int orion_mdio_wait_ready(const struct orion_mdio_ops *ops,
break;
if (dev->err_interrupt <= 0) {
- usleep_range(MVMDIO_SMI_POLL_INTERVAL_MIN,
- MVMDIO_SMI_POLL_INTERVAL_MAX);
+ usleep_range(ops->poll_interval_min,
+ ops->poll_interval_max);
if (time_is_before_jiffies(end))
++timedout;
@@ -113,6 +115,8 @@ static int orion_mdio_smi_is_done(struct orion_mdio_dev *dev)
static const struct orion_mdio_ops orion_mdio_smi_ops = {
.is_done = orion_mdio_smi_is_done,
+ .poll_interval_min = MVMDIO_SMI_POLL_INTERVAL_MIN,
+ .poll_interval_max = MVMDIO_SMI_POLL_INTERVAL_MAX,
};
static int orion_mdio_read(struct mii_bus *bus, int mii_id,