[3.19.y-ckt stable] Patch "net: phy: micrel: Fix regression in kszphy_probe" has been added to staging queue
Kamal Mostafa
kamal at canonical.com
Tue Jun 16 00:22:26 UTC 2015
This is a note to let you know that I have just added a patch titled
net: phy: micrel: Fix regression in kszphy_probe
to the linux-3.19.y-queue branch of the 3.19.y-ckt extended stable tree
which can be found at:
http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.19.y-queue
This patch is scheduled to be released in version 3.19.8-ckt2.
If you, or anyone else, feels it should not be added to this tree, please
reply to this email.
For more information about the 3.19.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Kamal
------
>From 5cd586f6085a7be5831f6529b7153d37f2af99ae Mon Sep 17 00:00:00 2001
From: Niklas Cassel <niklas.cassel at axis.com>
Date: Tue, 12 May 2015 09:43:14 +0200
Subject: net: phy: micrel: Fix regression in kszphy_probe
commit bced870152161435cc59a53e77f3699f8e8f22ca upstream.
Don't do clock-mode-select if clk == NULL,
since when building without CONFIG_HAVE_CLK,
clk_get returns NULL and clk_get_rate returns 0.
Doing clock-mode-select in this cause causes kszphy_probe to
return -EINVAL and thus prevents the device from being probed.
The original code (before regression) would return 0
when building without CONFIG_HAVE_CLK.
Fixes: 1fadee0c3645 ("net/phy: micrel: Add clock support for
KSZ8021/KSZ8031")
Reviewed-by: Fabio Estevam <fabio.estevam at freescale.com>
Reviewed-by: Johan Hovold <johan at kernel.org>
Signed-off-by: Niklas Cassel <niklass at axis.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
drivers/net/phy/micrel.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 3ad8ca7..96061fc 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -520,7 +520,8 @@ static int kszphy_probe(struct phy_device *phydev)
}
clk = devm_clk_get(&phydev->dev, "rmii-ref");
- if (!IS_ERR(clk)) {
+ /* NOTE: clk may be NULL if building without CONFIG_HAVE_CLK */
+ if (!IS_ERR_OR_NULL(clk)) {
unsigned long rate = clk_get_rate(clk);
bool rmii_ref_clk_sel_25_mhz;
--
1.9.1
More information about the kernel-team
mailing list