aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/smsc/smsc911x.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c
index 77ed74561e5f..f9c87624a0af 100644
--- a/drivers/net/ethernet/smsc/smsc911x.c
+++ b/drivers/net/ethernet/smsc/smsc911x.c
@@ -59,6 +59,8 @@
59#include <linux/of_device.h> 59#include <linux/of_device.h>
60#include <linux/of_gpio.h> 60#include <linux/of_gpio.h>
61#include <linux/of_net.h> 61#include <linux/of_net.h>
62#include <linux/pm_runtime.h>
63
62#include "smsc911x.h" 64#include "smsc911x.h"
63 65
64#define SMSC_CHIPNAME "smsc911x" 66#define SMSC_CHIPNAME "smsc911x"
@@ -2338,6 +2340,9 @@ static int smsc911x_drv_remove(struct platform_device *pdev)
2338 2340
2339 free_netdev(dev); 2341 free_netdev(dev);
2340 2342
2343 pm_runtime_put(&pdev->dev);
2344 pm_runtime_disable(&pdev->dev);
2345
2341 return 0; 2346 return 0;
2342} 2347}
2343 2348
@@ -2491,6 +2496,9 @@ static int smsc911x_drv_probe(struct platform_device *pdev)
2491 if (pdata->config.shift) 2496 if (pdata->config.shift)
2492 pdata->ops = &shifted_smsc911x_ops; 2497 pdata->ops = &shifted_smsc911x_ops;
2493 2498
2499 pm_runtime_enable(&pdev->dev);
2500 pm_runtime_get_sync(&pdev->dev);
2501
2494 retval = smsc911x_init(dev); 2502 retval = smsc911x_init(dev);
2495 if (retval < 0) 2503 if (retval < 0)
2496 goto out_disable_resources; 2504 goto out_disable_resources;
@@ -2572,6 +2580,8 @@ out_unregister_netdev_5:
2572out_free_irq: 2580out_free_irq:
2573 free_irq(dev->irq, dev); 2581 free_irq(dev->irq, dev);
2574out_disable_resources: 2582out_disable_resources:
2583 pm_runtime_put(&pdev->dev);
2584 pm_runtime_disable(&pdev->dev);
2575 (void)smsc911x_disable_resources(pdev); 2585 (void)smsc911x_disable_resources(pdev);
2576out_enable_resources_fail: 2586out_enable_resources_fail:
2577 smsc911x_free_resources(pdev); 2587 smsc911x_free_resources(pdev);