Revert "i2c: jz4780: prevent potential division by zero"
authorWolfram Sang <wsa@the-dreams.de>
Sat, 9 Apr 2016 06:32:37 +0000 (08:32 +0200)
committerWolfram Sang <wsa@the-dreams.de>
Sat, 9 Apr 2016 06:32:37 +0000 (08:32 +0200)
This reverts commit 34cf2acdafaa31a13821e45de5ee896adcd307b1. 'ret' is
not set when bailing out. Also, there is a better place to check for 0.

Reported-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-jz4780.c

index 597408fc6834fce711b89c26634ece928dfe9ad5..f325663c27c532645a1901a385ac6d52543e5ba5 100644 (file)
@@ -770,7 +770,7 @@ static int jz4780_i2c_probe(struct platform_device *pdev)
 
        ret = of_property_read_u32(pdev->dev.of_node, "clock-frequency",
                                   &clk_freq);
-       if (ret || clk_freq == 0) {
+       if (ret) {
                dev_err(&pdev->dev, "clock-frequency not specified in DT");
                goto err;
        }