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>