mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
i2c: Remove redundant 'driver' field from the i2c_client struct
The 'driver' field of the i2c_client struct is redundant. The same data can be accessed through to_i2c_driver(client->dev.driver). The generated code for both approaches in more or less the same. E.g. on ARM the expression client->driver->command(...) generates ... ldr r3, [r0, #28] ldr r3, [r3, #32] blx r3 ... and the expression to_i2c_driver(client->dev.driver)->command(...) generates ... ldr r3, [r0, #160] ldr r3, [r3, #-4] blx r3 ... Other architectures will generate similar code. All users of the 'driver' field outside of the I2C core have already been converted. So this only leaves the core itself. This patch converts the remaining few users in the I2C core and then removes the 'driver' field from the i2c_client struct. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
This commit is contained in:
parent
40df24997f
commit
0acc2b3213
3 changed files with 18 additions and 15 deletions
|
@ -205,7 +205,6 @@ struct i2c_driver {
|
|||
* @name: Indicates the type of the device, usually a chip name that's
|
||||
* generic enough to hide second-sourcing and compatible revisions.
|
||||
* @adapter: manages the bus segment hosting this I2C device
|
||||
* @driver: device's driver, hence pointer to access routines
|
||||
* @dev: Driver model device node for the slave.
|
||||
* @irq: indicates the IRQ generated by this device (if any)
|
||||
* @detected: member of an i2c_driver.clients list or i2c-core's
|
||||
|
@ -222,7 +221,6 @@ struct i2c_client {
|
|||
/* _LOWER_ 7 bits */
|
||||
char name[I2C_NAME_SIZE];
|
||||
struct i2c_adapter *adapter; /* the adapter we sit on */
|
||||
struct i2c_driver *driver; /* and our access routines */
|
||||
struct device dev; /* the device structure */
|
||||
int irq; /* irq issued by device */
|
||||
struct list_head detected;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue