diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-04-30 14:19:23 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-04-30 14:19:23 -0700 |
commit | 86281966c7395aa9a13a20c52e26005f5e142451 (patch) | |
tree | a4a14499819cc861ac8939935883c2840b0ba216 /drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | |
parent | d1db0eea852497762cab43b905b879dfcd3b8987 (diff) | |
parent | bbc28134e915d2e2e8cac0254d1d056db0ae3247 (diff) |
Merge tag 'iio-fixes-for-3.15b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linusstaging-3.15-rc4
Jonathan writes:
Second set of fixes for IIO in the 3.15 cycle.
* ad2s1200 - Fix some missing parenthesis in a for statement that could have
led to an error being missed when getting gpios.
* Fix a null derefference issue in the mpu6050 when platform data is not
provided (or is provided via the device tree for example).
* exynos_adc bug on remove due to child devices having been added to the
parent of the IIO device rather than the IIO device itself. This caused an
issue with the IIO device removing itself in it's remove function.
* Make all ADC drivers buildable as modules to avoid dependency issues if
the IIO core is itself built as a module. The exynos adc bug became
apparently whilst this fix was being tested.
Diffstat (limited to 'drivers/iio/imu/inv_mpu6050/inv_mpu_core.c')
-rw-r--r-- | drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c index cb9f96b446a5..d8ad606c7cd0 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c @@ -660,6 +660,7 @@ static int inv_mpu_probe(struct i2c_client *client, { struct inv_mpu6050_state *st; struct iio_dev *indio_dev; + struct inv_mpu6050_platform_data *pdata; int result; if (!i2c_check_functionality(client->adapter, @@ -672,8 +673,10 @@ static int inv_mpu_probe(struct i2c_client *client, st = iio_priv(indio_dev); st->client = client; - st->plat_data = *(struct inv_mpu6050_platform_data - *)dev_get_platdata(&client->dev); + pdata = (struct inv_mpu6050_platform_data + *)dev_get_platdata(&client->dev); + if (pdata) + st->plat_data = *pdata; /* power is turned on inside check chip type*/ result = inv_check_and_setup_chip(st, id); if (result) |