@@ -63,6 +63,9 @@ struct orion_mdio_dev {
int err_interrupt;
wait_queue_head_t smi_busy_wait;
struct orion_mdio_ops *ops;
+
+ unsigned int poll_interval_min;
+ unsigned int poll_interval_max;
};
struct orion_mdio_ops {
@@ -123,8 +126,8 @@ static int orion_mdio_wait_ready(struct mii_bus *bus)
break;
if (dev->err_interrupt <= 0) {
- usleep_range(MVMDIO_SMI_POLL_INTERVAL_MIN,
- MVMDIO_SMI_POLL_INTERVAL_MAX);
+ usleep_range(dev->poll_interval_min,
+ dev->poll_interval_max);
if (time_is_before_jiffies(end))
++timedout;
@@ -279,6 +282,8 @@ static int orion_mdio_probe(struct platform_device *pdev)
if (!ops)
return -ENOMEM;
+ dev->poll_interval_min = MVMDIO_SMI_POLL_INTERVAL_MIN;
+ dev->poll_interval_max = MVMDIO_SMI_POLL_INTERVAL_MAX;
ops->is_done = orion_mdio_smi_is_done;
ops->is_read_valid = orion_mdio_smi_is_read_valid;
ops->start_read = orion_mdio_start_read_op;
Put the two poll intervals (min and max) in the driver's private structure. This is needed to add the xmdio support later. Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com> --- drivers/net/ethernet/marvell/mvmdio.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)