Commit 72ee734a authored by Wolfram Sang's avatar Wolfram Sang

i2c: mxs: correctly setup speed for non devicetree

Commit cd4f2d4a (i2c: mxs: Set I2C timing registers for mxs-i2c) only
covered the case for devicetree and made platform_data based boards
bail out with -EINVAL. Correctly support the latter one, too.
Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
parent c076ada4
...@@ -365,10 +365,6 @@ static int mxs_i2c_get_ofdata(struct mxs_i2c_dev *i2c) ...@@ -365,10 +365,6 @@ static int mxs_i2c_get_ofdata(struct mxs_i2c_dev *i2c)
struct device_node *node = dev->of_node; struct device_node *node = dev->of_node;
int ret; int ret;
if (!node)
return -EINVAL;
i2c->speed = &mxs_i2c_95kHz_config;
ret = of_property_read_u32(node, "clock-frequency", &speed); ret = of_property_read_u32(node, "clock-frequency", &speed);
if (ret) if (ret)
dev_warn(dev, "No I2C speed selected, using 100kHz\n"); dev_warn(dev, "No I2C speed selected, using 100kHz\n");
...@@ -419,10 +415,13 @@ static int __devinit mxs_i2c_probe(struct platform_device *pdev) ...@@ -419,10 +415,13 @@ static int __devinit mxs_i2c_probe(struct platform_device *pdev)
return err; return err;
i2c->dev = dev; i2c->dev = dev;
i2c->speed = &mxs_i2c_95kHz_config;
err = mxs_i2c_get_ofdata(i2c); if (dev->of_node) {
if (err) err = mxs_i2c_get_ofdata(i2c);
return err; if (err)
return err;
}
platform_set_drvdata(pdev, i2c); platform_set_drvdata(pdev, i2c);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment