aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfram Sang <wsa@the-dreams.de>2015-01-07 06:24:10 -0500
committerWolfram Sang <wsa@the-dreams.de>2015-03-13 10:10:57 -0400
commit7ee405ea068602d1fd42bf14ddc04d45733cfd7d (patch)
tree43fb9392da5a6a4ec4fa871fbba347a4927ff7ac
parentafe90203977bc7ecd7d1048a5ad453a8670c16f5 (diff)
i2c: powermac: make use of the new infrastructure for quirks
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
-rw-r--r--drivers/i2c/busses/i2c-powermac.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/i2c/busses/i2c-powermac.c b/drivers/i2c/busses/i2c-powermac.c
index 60a53c169ed2..6abcf696e359 100644
--- a/drivers/i2c/busses/i2c-powermac.c
+++ b/drivers/i2c/busses/i2c-powermac.c
@@ -153,12 +153,6 @@ static int i2c_powermac_master_xfer( struct i2c_adapter *adap,
153 int read; 153 int read;
154 int addrdir; 154 int addrdir;
155 155
156 if (num != 1) {
157 dev_err(&adap->dev,
158 "Multi-message I2C transactions not supported\n");
159 return -EOPNOTSUPP;
160 }
161
162 if (msgs->flags & I2C_M_TEN) 156 if (msgs->flags & I2C_M_TEN)
163 return -EINVAL; 157 return -EINVAL;
164 read = (msgs->flags & I2C_M_RD) != 0; 158 read = (msgs->flags & I2C_M_RD) != 0;
@@ -205,6 +199,9 @@ static const struct i2c_algorithm i2c_powermac_algorithm = {
205 .functionality = i2c_powermac_func, 199 .functionality = i2c_powermac_func,
206}; 200};
207 201
202static struct i2c_adapter_quirks i2c_powermac_quirks = {
203 .max_num_msgs = 1,
204};
208 205
209static int i2c_powermac_remove(struct platform_device *dev) 206static int i2c_powermac_remove(struct platform_device *dev)
210{ 207{
@@ -434,6 +431,7 @@ static int i2c_powermac_probe(struct platform_device *dev)
434 431
435 platform_set_drvdata(dev, adapter); 432 platform_set_drvdata(dev, adapter);
436 adapter->algo = &i2c_powermac_algorithm; 433 adapter->algo = &i2c_powermac_algorithm;
434 adapter->quirks = &i2c_powermac_quirks;
437 i2c_set_adapdata(adapter, bus); 435 i2c_set_adapdata(adapter, bus);
438 adapter->dev.parent = &dev->dev; 436 adapter->dev.parent = &dev->dev;
439 437