Make sure we don't OOPS in case clock-frequency is set to 0 in a DT. The
variable set here is later used as a divisor.
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
ret = of_property_read_u32(pdev->dev.of_node, "clock-frequency",
&clk_freq);
ret = of_property_read_u32(pdev->dev.of_node, "clock-frequency",
&clk_freq);
+ if (ret || clk_freq == 0) {
dev_err(&pdev->dev, "clock-frequency not specified in DT");
goto err;
}
dev_err(&pdev->dev, "clock-frequency not specified in DT");
goto err;
}