]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commit
staging: iio: light: cm3217: fix probe, remove and shutdown paths
authorSri Krishna chowdary <schowdary@nvidia.com>
Fri, 2 May 2014 11:53:31 +0000 (17:23 +0530)
committerTony Ly <tly@nvidia.com>
Thu, 8 May 2014 22:09:38 +0000 (15:09 -0700)
commit304f40730757c5191b2db81f1b246fa364d15203
tree568ec7ae353da2841934982439053817e31c8cc6
parent45d5897a189a2ea5288fa11fd9cc666496e5f847
staging: iio: light: cm3217: fix probe, remove and shutdown paths

On device probe
workqueue should be created before registering device to avoid
scheduling workqueue on non existant workqueue.

On device remove
1. Regulator can still be in use till all pending works are
finished. Do not free them before ensuring no more access to
device will occur.
2. Remove sysfs to ensure no user access after destroying
the workqueue

Ideally we may want to regulator_put on device shutdown but
that step requires destroying the workqueue and unregistering sysfs.
Unregistering sysfs probably causes Bug 1463497 and hence taking the
safe option for now and removing device shutdown alogether.

Bug 1507601

Change-Id: I9e1a74dc1f4287c381812ee5a2a8a5e2eefe15dd
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/404368
(cherry picked from commit c16e0090f23132b343083c51057b729f04809028)
Reviewed-on: http://git-master/r/405262
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
drivers/staging/iio/light/cm3217.c