brcm63xx: add kernel 4.9 support
[openwrt/openwrt.git] / target / linux / brcm63xx / patches-4.9 / 001-4.15-12-bcm63xx_enet-drop-unneeded-NULL-phy_clk-check.patch
1 From 555baec974ede81e616ca88ac6d3fca09239368f Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jonas.gorski@gmail.com>
3 Date: Tue, 18 Jul 2017 13:18:01 +0200
4 Subject: [PATCH 5/6] bcm63xx_enet: drop unneeded NULL phy_clk check
5
6 clk_disable and clk_unprepare are NULL-safe, so need to duplicate the
7 NULL check of the functions.
8
9 Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
10 ---
11 drivers/net/ethernet/broadcom/bcm63xx_enet.c | 7 ++-----
12 1 file changed, 2 insertions(+), 5 deletions(-)
13
14 --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
15 +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
16 @@ -1918,8 +1918,7 @@ out_free_mdio:
17 out_uninit_hw:
18 /* turn off mdc clock */
19 enet_writel(priv, 0, ENET_MIISC_REG);
20 - if (priv->phy_clk)
21 - clk_disable_unprepare(priv->phy_clk);
22 + clk_disable_unprepare(priv->phy_clk);
23
24 out_disable_clk_mac:
25 clk_disable_unprepare(priv->mac_clk);
26 @@ -1958,9 +1957,7 @@ static int bcm_enet_remove(struct platfo
27 }
28
29 /* disable hw block clocks */
30 - if (priv->phy_clk)
31 - clk_disable_unprepare(priv->phy_clk);
32 -
33 + clk_disable_unprepare(priv->phy_clk);
34 clk_disable_unprepare(priv->mac_clk);
35
36 free_netdev(dev);