]> git.baikalelectronics.ru Git - kernel.git/commit
staging: iio: ak8975: Remove i2c client data corruption
authorPreetham Chandru <pchandru@nvidia.com>
Mon, 9 Apr 2012 12:35:01 +0000 (18:05 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Apr 2012 16:19:29 +0000 (09:19 -0700)
commit2fa536481aca2b19307bcc1b1e67fc7f99559a9d
tree2b16d03b41eb7efd1bdb16ac5aba0b04ceba087c
parent13be3477a35a428b809fc415ae15ae6f0726be07
staging: iio: ak8975: Remove i2c client data corruption

i2c client data set is of type struct indio_dev pointer and hence the
pointer returned from i2c_get_clientdata() should be assigned to
an object of type struct indio_dev and not to an object of type
struct ak8975_data.

Also in ak8975_probe() client data should be set first
before calling ak8975_setup() as it references the client data.

Signed-off-by: Preetham Chandru R <pchandru@nvidia.com>
CC: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/iio/magnetometer/ak8975.c