]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
i2c: Add info->archdata field
authorAnton Vorontsov <avorontsov@ru.mvista.com>
Wed, 22 Oct 2008 18:21:33 +0000 (20:21 +0200)
committerJean Delvare <khali@linux-fr.org>
Wed, 22 Oct 2008 18:21:33 +0000 (20:21 +0200)
If present the info->archdata is copied into the dev->archdata.
Some (OpenFirmware) platforms need it.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
drivers/i2c/i2c-core.c
include/linux/i2c.h

index 42e852d79ffaa5b001dda2c44219cad064a537e7..5a485c22660a9cc97d5d72d1e6ccad38e5b0658e 100644 (file)
@@ -266,6 +266,9 @@ i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info)
 
        client->dev.platform_data = info->platform_data;
 
+       if (info->archdata)
+               client->dev.archdata = *info->archdata;
+
        client->flags = info->flags;
        client->addr = info->addr;
        client->irq = info->irq;
index 12d7364ad3f3b57018ace504a1adac9e2716ddce..33a5992d493651383e00832b13b69f396d77bfff 100644 (file)
@@ -239,6 +239,7 @@ static inline void i2c_set_clientdata(struct i2c_client *dev, void *data)
  * @flags: to initialize i2c_client.flags
  * @addr: stored in i2c_client.addr
  * @platform_data: stored in i2c_client.dev.platform_data
+ * @archdata: copied into i2c_client.dev.archdata
  * @irq: stored in i2c_client.irq
  *
  * I2C doesn't actually support hardware probing, although controllers and
@@ -258,6 +259,7 @@ struct i2c_board_info {
        unsigned short  flags;
        unsigned short  addr;
        void            *platform_data;
+       struct dev_archdata     *archdata;
        int             irq;
 };