aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/ti/davinci_mdio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/ti/davinci_mdio.c')
-rw-r--r--drivers/net/ethernet/ti/davinci_mdio.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c
index 12aec173564c..c47f0dbcebb5 100644
--- a/drivers/net/ethernet/ti/davinci_mdio.c
+++ b/drivers/net/ethernet/ti/davinci_mdio.c
@@ -449,10 +449,9 @@ static int davinci_mdio_suspend(struct device *dev)
449 __raw_writel(ctrl, &data->regs->control); 449 __raw_writel(ctrl, &data->regs->control);
450 wait_for_idle(data); 450 wait_for_idle(data);
451 451
452 pm_runtime_put_sync(data->dev);
453
454 data->suspended = true; 452 data->suspended = true;
455 spin_unlock(&data->lock); 453 spin_unlock(&data->lock);
454 pm_runtime_put_sync(data->dev);
456 455
457 return 0; 456 return 0;
458} 457}
@@ -460,15 +459,12 @@ static int davinci_mdio_suspend(struct device *dev)
460static int davinci_mdio_resume(struct device *dev) 459static int davinci_mdio_resume(struct device *dev)
461{ 460{
462 struct davinci_mdio_data *data = dev_get_drvdata(dev); 461 struct davinci_mdio_data *data = dev_get_drvdata(dev);
463 u32 ctrl;
464 462
465 spin_lock(&data->lock);
466 pm_runtime_get_sync(data->dev); 463 pm_runtime_get_sync(data->dev);
467 464
465 spin_lock(&data->lock);
468 /* restart the scan state machine */ 466 /* restart the scan state machine */
469 ctrl = __raw_readl(&data->regs->control); 467 __davinci_mdio_reset(data);
470 ctrl |= CONTROL_ENABLE;
471 __raw_writel(ctrl, &data->regs->control);
472 468
473 data->suspended = false; 469 data->suspended = false;
474 spin_unlock(&data->lock); 470 spin_unlock(&data->lock);
@@ -477,8 +473,8 @@ static int davinci_mdio_resume(struct device *dev)
477} 473}
478 474
479static const struct dev_pm_ops davinci_mdio_pm_ops = { 475static const struct dev_pm_ops davinci_mdio_pm_ops = {
480 .suspend = davinci_mdio_suspend, 476 .suspend_late = davinci_mdio_suspend,
481 .resume = davinci_mdio_resume, 477 .resume_early = davinci_mdio_resume,
482}; 478};
483 479
484static const struct of_device_id davinci_mdio_of_mtable[] = { 480static const struct of_device_id davinci_mdio_of_mtable[] = {