From: Jonas Gorski <jonas.gorski@gmail.com>
To: netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.or
Cc: "David S. Miller" <davem@davemloft.net>,
Florian Fainelli <f.fainelli@gmail.com>,
bcm-kernel-feedback-list@broadcom.com
Subject: [PATCH 5/6] bcm63xx_enet: drop unneeded NULL phy_clk check
Date: Sun, 1 Oct 2017 13:02:19 +0200 [thread overview]
Message-ID: <20171001110220.27668-6-jonas.gorski@gmail.com> (raw)
In-Reply-To: <20171001110220.27668-1-jonas.gorski@gmail.com>
clk_disable and clk_unprepare are NULL-safe, so need to duplicate the
NULL check of the functions.
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
drivers/net/ethernet/broadcom/bcm63xx_enet.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index 059ef4f1d137..f6bc13fe8a99 100644
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -1903,8 +1903,7 @@ static int bcm_enet_probe(struct platform_device *pdev)
out_uninit_hw:
/* turn off mdc clock */
enet_writel(priv, 0, ENET_MIISC_REG);
- if (priv->phy_clk)
- clk_disable_unprepare(priv->phy_clk);
+ clk_disable_unprepare(priv->phy_clk);
out_disable_clk_mac:
clk_disable_unprepare(priv->mac_clk);
@@ -1943,9 +1942,7 @@ static int bcm_enet_remove(struct platform_device *pdev)
}
/* disable hw block clocks */
- if (priv->phy_clk)
- clk_disable_unprepare(priv->phy_clk);
-
+ clk_disable_unprepare(priv->phy_clk);
clk_disable_unprepare(priv->mac_clk);
free_netdev(dev);
--
2.13.2
next prev parent reply other threads:[~2017-10-01 11:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-01 11:02 [PATCH 0/6] bcm63xx_enet: small fixes and cleanups Jonas Gorski
2017-10-01 11:02 ` [PATCH 1/6] bcm63xx_enet: correct clock usage Jonas Gorski
2017-10-01 11:02 ` [PATCH 2/6] bcm63xx_enet: do not write to random DMA channel on BCM6345 Jonas Gorski
2017-10-01 11:02 ` [PATCH 3/6] bcm63xx_enet: do not rely on probe order Jonas Gorski
2017-10-01 11:02 ` [PATCH 4/6] bcm63xx_enet: use managed functions for clock/ioremap Jonas Gorski
2017-10-01 11:02 ` Jonas Gorski [this message]
2017-10-01 11:02 ` [PATCH 6/6] bcm63xx_enet: remove unneeded include Jonas Gorski
2017-10-02 6:06 ` [PATCH 0/6] bcm63xx_enet: small fixes and cleanups David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171001110220.27668-6-jonas.gorski@gmail.com \
--to=jonas.gorski@gmail.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.or \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).