Merge branch 'for-linus' of git://git.kernel.dk/linux-block
[deliverable/linux.git] / drivers / i2c / busses / i2c-jz4780.c
index f325663c27c532645a1901a385ac6d52543e5ba5..ba14a863b451f943ea862bb94d2f808554a397d0 100644 (file)
@@ -771,11 +771,16 @@ static int jz4780_i2c_probe(struct platform_device *pdev)
        ret = of_property_read_u32(pdev->dev.of_node, "clock-frequency",
                                   &clk_freq);
        if (ret) {
-               dev_err(&pdev->dev, "clock-frequency not specified in DT");
+               dev_err(&pdev->dev, "clock-frequency not specified in DT\n");
                goto err;
        }
 
        i2c->speed = clk_freq / 1000;
+       if (i2c->speed == 0) {
+               ret = -EINVAL;
+               dev_err(&pdev->dev, "clock-frequency minimum is 1000\n");
+               goto err;
+       }
        jz4780_i2c_set_speed(i2c);
 
        dev_info(&pdev->dev, "Bus frequency is %d KHz\n", i2c->speed);
This page took 0.035544 seconds and 5 git commands to generate.