]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: micrel: Fix regression in kszphy_probe
authorNiklas Cassel <niklas.cassel@axis.com>
Tue, 12 May 2015 07:43:14 +0000 (09:43 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 May 2015 03:18:40 +0000 (23:18 -0400)
commitf7faeedd04dd7363d877ffc029b0f534e42969fe
tree9e8fc570004c5c77d5edc5935509dd0e02e94ef3
parent3b6ff3c5b2f3366d17c352075404a51779e93565
net: phy: micrel: Fix regression in kszphy_probe

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.

Cc: stable <stable@vger.kernel.org> # 3.18+
Fixes: cb3d35105a98 ("net/phy: micrel: Add clock support for
KSZ8021/KSZ8031")
Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com>
Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Niklas Cassel <niklass@axis.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/micrel.c