]> rtime.felk.cvut.cz Git - zynq/linux.git/commit
net: macb: Add NULL check for PCLK and HCLK
authorHarini Katakam <harini.katakam@xilinx.com>
Fri, 22 Mar 2019 05:20:00 +0000 (10:50 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Fri, 22 Mar 2019 07:46:52 +0000 (08:46 +0100)
commite393646b6923ef95d03b94eff8874a4b49da5fba
treeb56a18cb4d1e76d89d7df05aa5cfa07029743dc0
parent514d7c412d7ea2238941166591290172d0a265e9
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>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/net/ethernet/cadence/macb_main.c