diff options
author | Laurentiu Palcu <laurentiu.palcu@intel.com> | 2014-08-29 04:38:00 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2014-08-30 06:44:26 -0400 |
commit | b31b05cf629574d47b324bb52128ed1b199faccd (patch) | |
tree | 4b4c38824914bcafeac5dfcadb6282d3924fcdb4 /drivers/iio | |
parent | 823615e2de6880de3c8e681333147a09719f6fdb (diff) |
iio: accel: BMC150: fix issues when CONFIG_PM_RUNTIME is not set
When CONFIG_PM_RUNTIME is not set, the following issues are seen:
* warning message at compilation time:
warning: 'bmc150_accel_get_startup_times' defined but not used [-Wunused-function]
* bmc150_accel_set_power_state() will always fail and reading the
accelerometer data is impossible;
This occurs because of the call to pm_runtime_put_autosuspend calls
__pm_runtime_suspend which returns -ENOSYS.
This commit fixes these.
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/accel/bmc150-accel.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/iio/accel/bmc150-accel.c b/drivers/iio/accel/bmc150-accel.c index ccb6cf83f5f5..0e6566adca24 100644 --- a/drivers/iio/accel/bmc150-accel.c +++ b/drivers/iio/accel/bmc150-accel.c | |||
@@ -499,6 +499,7 @@ static int bmc150_accel_get_bw(struct bmc150_accel_data *data, int *val, | |||
499 | return -EINVAL; | 499 | return -EINVAL; |
500 | } | 500 | } |
501 | 501 | ||
502 | #ifdef CONFIG_PM_RUNTIME | ||
502 | static int bmc150_accel_get_startup_times(struct bmc150_accel_data *data) | 503 | static int bmc150_accel_get_startup_times(struct bmc150_accel_data *data) |
503 | { | 504 | { |
504 | int i; | 505 | int i; |
@@ -529,6 +530,12 @@ static int bmc150_accel_set_power_state(struct bmc150_accel_data *data, bool on) | |||
529 | 530 | ||
530 | return 0; | 531 | return 0; |
531 | } | 532 | } |
533 | #else | ||
534 | static int bmc150_accel_set_power_state(struct bmc150_accel_data *data, bool on) | ||
535 | { | ||
536 | return 0; | ||
537 | } | ||
538 | #endif | ||
532 | 539 | ||
533 | static int bmc150_accel_set_scale(struct bmc150_accel_data *data, int val) | 540 | static int bmc150_accel_set_scale(struct bmc150_accel_data *data, int val) |
534 | { | 541 | { |