Commit e0d9c58c authored by Wolfram Sang's avatar Wolfram Sang Committed by Greg Kroah-Hartman

i2c: omap: use core to detect 'no zero length' quirk

[ Upstream commit f37b2bb6 ]

And don't reimplement in the driver.
Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
Acked-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent f3afad5d
...@@ -661,9 +661,6 @@ static int omap_i2c_xfer_msg(struct i2c_adapter *adap, ...@@ -661,9 +661,6 @@ static int omap_i2c_xfer_msg(struct i2c_adapter *adap,
dev_dbg(omap->dev, "addr: 0x%04x, len: %d, flags: 0x%x, stop: %d\n", dev_dbg(omap->dev, "addr: 0x%04x, len: %d, flags: 0x%x, stop: %d\n",
msg->addr, msg->len, msg->flags, stop); msg->addr, msg->len, msg->flags, stop);
if (msg->len == 0)
return -EINVAL;
omap->receiver = !!(msg->flags & I2C_M_RD); omap->receiver = !!(msg->flags & I2C_M_RD);
omap_i2c_resize_fifo(omap, msg->len, omap->receiver); omap_i2c_resize_fifo(omap, msg->len, omap->receiver);
...@@ -1179,6 +1176,10 @@ static const struct i2c_algorithm omap_i2c_algo = { ...@@ -1179,6 +1176,10 @@ static const struct i2c_algorithm omap_i2c_algo = {
.functionality = omap_i2c_func, .functionality = omap_i2c_func,
}; };
static const struct i2c_adapter_quirks omap_i2c_quirks = {
.flags = I2C_AQ_NO_ZERO_LEN,
};
#ifdef CONFIG_OF #ifdef CONFIG_OF
static struct omap_i2c_bus_platform_data omap2420_pdata = { static struct omap_i2c_bus_platform_data omap2420_pdata = {
.rev = OMAP_I2C_IP_VERSION_1, .rev = OMAP_I2C_IP_VERSION_1,
...@@ -1453,6 +1454,7 @@ omap_i2c_probe(struct platform_device *pdev) ...@@ -1453,6 +1454,7 @@ omap_i2c_probe(struct platform_device *pdev)
adap->class = I2C_CLASS_DEPRECATED; adap->class = I2C_CLASS_DEPRECATED;
strlcpy(adap->name, "OMAP I2C adapter", sizeof(adap->name)); strlcpy(adap->name, "OMAP I2C adapter", sizeof(adap->name));
adap->algo = &omap_i2c_algo; adap->algo = &omap_i2c_algo;
adap->quirks = &omap_i2c_quirks;
adap->dev.parent = &pdev->dev; adap->dev.parent = &pdev->dev;
adap->dev.of_node = pdev->dev.of_node; adap->dev.of_node = pdev->dev.of_node;
adap->bus_recovery_info = &omap_i2c_bus_recovery_info; adap->bus_recovery_info = &omap_i2c_bus_recovery_info;
......
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