]> git.baikalelectronics.ru Git - kernel.git/commit
net: macb: Add null check for PCLK and HCLK
authorHarini Katakam <harini.katakam@xilinx.com>
Wed, 20 Mar 2019 13:42:22 +0000 (19:12 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Mar 2019 20:22:41 +0000 (13:22 -0700)
commit82bff37911c717ac36c5aae9055d8ef0f23d37ff
tree4f0219e80adbc12e69d89e53f5d8c960fa9bd62a
parent7f6976e2a90319224258ca3828d2d2f5e00763ce
net: macb: Add null check for PCLK and HCLK

Both PCLK and HCLK are "required" clocks according to macb devicetree
documentation. There is a chance that devm_clk_get doesn't return a
negative error but just a NULL clock structure instead. In such a case
the driver proceeds as usual and uses pclk value 0 to calculate MDC
divisor which is incorrect. Hence fix the same in clock initialization.

Signed-off-by: Harini Katakam <harini.katakam@xilinx.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cadence/macb_main.c