.. | .. |
---|
3850 | 3850 | struct device_node *np = pdev->dev.of_node; |
---|
3851 | 3851 | int ret; |
---|
3852 | 3852 | |
---|
3853 | | - ret = pm_runtime_resume_and_get(&pdev->dev); |
---|
| 3853 | + ret = pm_runtime_get_sync(&pdev->dev); |
---|
3854 | 3854 | if (ret < 0) |
---|
3855 | | - return ret; |
---|
| 3855 | + dev_err(&pdev->dev, |
---|
| 3856 | + "Failed to resume device in remove callback (%pe)\n", |
---|
| 3857 | + ERR_PTR(ret)); |
---|
3856 | 3858 | |
---|
3857 | 3859 | cancel_work_sync(&fep->tx_timeout_work); |
---|
3858 | 3860 | fec_ptp_stop(pdev); |
---|
.. | .. |
---|
3865 | 3867 | of_phy_deregister_fixed_link(np); |
---|
3866 | 3868 | of_node_put(fep->phy_node); |
---|
3867 | 3869 | |
---|
3868 | | - clk_disable_unprepare(fep->clk_ahb); |
---|
3869 | | - clk_disable_unprepare(fep->clk_ipg); |
---|
| 3870 | + /* After pm_runtime_get_sync() failed, the clks are still off, so skip |
---|
| 3871 | + * disabling them again. |
---|
| 3872 | + */ |
---|
| 3873 | + if (ret >= 0) { |
---|
| 3874 | + clk_disable_unprepare(fep->clk_ahb); |
---|
| 3875 | + clk_disable_unprepare(fep->clk_ipg); |
---|
| 3876 | + } |
---|
3870 | 3877 | pm_runtime_put_noidle(&pdev->dev); |
---|
3871 | 3878 | pm_runtime_disable(&pdev->dev); |
---|
3872 | 3879 | |
---|