Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1307561 > unrolled thread
| Started by | Lothar Waßmann <LW@KARO-electronics.de> |
|---|---|
| First post | 2016-01-12 16:40 +0100 |
| Last post | 2016-01-12 16:40 +0100 |
| Articles | 2 — 1 participant |
Back to article view | Back to linux.kernel
[PATCHv2 0/2] net: fec: Reset ethernet PHY whenever the enet_out clock is being enabled Lothar Waßmann <LW@KARO-electronics.de> - 2016-01-12 16:40 +0100
[PATCHv2 1/2] remove redundant struct clk NULL checks Lothar Waßmann <LW@KARO-electronics.de> - 2016-01-12 16:40 +0100
| From | Lothar Waßmann <LW@KARO-electronics.de> |
|---|---|
| Date | 2016-01-12 16:40 +0100 |
| Subject | [PATCHv2 0/2] net: fec: Reset ethernet PHY whenever the enet_out clock is being enabled |
| Message-ID | <qQ93t-2Pd-45@gated-at.bofh.it> |
This patchset fixes a regression introduced by
commit e8fcfcd5684a ("net: fec: optimize the clock management to save power")
for ethernet PHYs that are using ENET_OUT as reference clock (on i.MX6 or i.MX28)
Changes vs. v1:
- fixed reference to the commit that introduced the regression.
- dropped patch to use gpiod framework. This should be added later,
after the affected DTBs have been updated to specify the correct
gpio_flags.
Patch overview:
1. cleanup patch to remove redundant NULL checks
2. call fec_reset_phy() after the ENET_OUT clock has been enabled
[toc] | [next] | [standalone]
| From | Lothar Waßmann <LW@KARO-electronics.de> |
|---|---|
| Date | 2016-01-12 16:40 +0100 |
| Subject | [PATCHv2 1/2] remove redundant struct clk NULL checks |
| Message-ID | <qQ93t-2Pd-59@gated-at.bofh.it> |
| In reply to | #1307561 |
NULL is a valid argument to clk_enable()/clk_disable(). Remove
redundant checks before calling those functions.
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
drivers/net/ethernet/freescale/fec_main.c | 23 +++++++++--------------
1 file changed, 9 insertions(+), 14 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 502da6f..592a7a4 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1874,35 +1874,30 @@ static int fec_enet_clk_enable(struct net_device *ndev, bool enable)
}
mutex_unlock(&fep->ptp_clk_mutex);
}
- if (fep->clk_ref) {
- ret = clk_prepare_enable(fep->clk_ref);
- if (ret)
- goto failed_clk_ref;
- }
+
+ ret = clk_prepare_enable(fep->clk_ref);
+ if (ret)
+ goto failed_clk_ref;
} else {
clk_disable_unprepare(fep->clk_ahb);
- if (fep->clk_enet_out)
- clk_disable_unprepare(fep->clk_enet_out);
+ clk_disable_unprepare(fep->clk_enet_out);
if (fep->clk_ptp) {
mutex_lock(&fep->ptp_clk_mutex);
clk_disable_unprepare(fep->clk_ptp);
fep->ptp_clk_on = false;
mutex_unlock(&fep->ptp_clk_mutex);
}
- if (fep->clk_ref)
- clk_disable_unprepare(fep->clk_ref);
+ clk_disable_unprepare(fep->clk_ref);
}
return 0;
failed_clk_ref:
- if (fep->clk_ref)
- clk_disable_unprepare(fep->clk_ref);
+ clk_disable_unprepare(fep->clk_ref);
failed_clk_ptp:
- if (fep->clk_enet_out)
- clk_disable_unprepare(fep->clk_enet_out);
+ clk_disable_unprepare(fep->clk_enet_out);
failed_clk_enet_out:
- clk_disable_unprepare(fep->clk_ahb);
+ clk_disable_unprepare(fep->clk_ahb);
return ret;
}
--
2.1.4
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web