i2c: Remove redundant 'driver' field from the i2c_client struct
authorLars-Peter Clausen <lars@metafoo.de>
Sun, 29 Sep 2013 08:51:06 +0000 (10:51 +0200)
committerWolfram Sang <wsa@the-dreams.de>
Thu, 3 Oct 2013 20:28:31 +0000 (22:28 +0200)
commit0acc2b321342aa813fa9fc485afb09fbc811f594
tree7c7ba32188f4b48f88feca5ca9c8fc834129a64e
parent40df24997f947ab5b745d570d56a003705868dcc
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>
drivers/i2c/i2c-core.c
drivers/i2c/i2c-smbus.c
include/linux/i2c.h