summaryrefslogtreecommitdiff
path: root/drivers/i2c/busses/i2c-jz4780.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2016-04-27 17:30:49 +0200
committerTakashi Iwai <tiwai@suse.de>2016-04-27 17:30:49 +0200
commitaf9cc93c0dee5fc1f9fa32cd9d79a456738a21be (patch)
tree91aed45708ad9782de42560ecd25ea5f740dae9b /drivers/i2c/busses/i2c-jz4780.c
parentbb03ed216370cb021f377f923471e56d1de3ff5d (diff)
parent8c0f55100478649e3c0133684aa4aebab77ce10f (diff)
Merge tag 'asoc-fix-v4.6-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v4.6 This is a fairly large collection of fixes but almost all driver specific ones, especially to the new Intel drivers which have had a lot of recent development. The one core fix is a change to the debugfs code to avoid crashes in some relatively unusual configurations.
Diffstat (limited to 'drivers/i2c/busses/i2c-jz4780.c')
-rw-r--r--drivers/i2c/busses/i2c-jz4780.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-jz4780.c b/drivers/i2c/busses/i2c-jz4780.c
index f325663c27c5..ba14a863b451 100644
--- a/drivers/i2c/busses/i2c-jz4780.c
+++ b/drivers/i2c/busses/i2c-jz4780.c
@@ -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);