iio: Reconcile operation order between iio_register/unregister and pm functions
authorAdriana Reus <adriana.reus@intel.com>
Thu, 5 Nov 2015 14:25:29 +0000 (16:25 +0200)
committerJonathan Cameron <jic23@kernel.org>
Sun, 8 Nov 2015 15:36:53 +0000 (15:36 +0000)
commit7d0ead5c3f00a0652fa4436f0d2dd05e9f2de140
tree484cd7c138d031fa88e176bf523aaad36c6cb518
parent536bbca7cfc9e7a85704de552fcf4b5d1062a38e
iio: Reconcile operation order between iio_register/unregister and pm functions

At probe, runtime pm should be setup before registering the sysfs interface so
that all the power attributes are accurate and functional when registering.
Also, when removing the device we should unregister first to make sure
that the interfaces that may result in wakeups are no longer available.

Fix this behaviour for the following drivers: bmc150, bmg160, kmx61,
kxcj-1013, mma9551, mma9553, rpr0521.

Signed-off-by: Adriana Reus <adriana.reus@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/accel/bmc150-accel-core.c
drivers/iio/accel/kxcjk-1013.c
drivers/iio/accel/mma9551.c
drivers/iio/accel/mma9553.c
drivers/iio/gyro/bmg160_core.c
drivers/iio/imu/kmx61.c
drivers/iio/light/rpr0521.c
drivers/iio/magnetometer/bmc150_magn.c