mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
DLKM:optimise sar sensor remove function
-release related resource about sarsensor registered in probe -issue:DLKM // kernel panic when rmmod sx932x_sar or abov_sar module Change-Id: Ib8da9744eab96c253f224232e111488ca2c93445 Signed-off-by: chenlj2 <chenlj2@motorola.com> Reviewed-on: https://gerrit.mot.com/1247406 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Wen Xie <xiewen3@motorola.com> Reviewed-by: Jun Weng <wengjun1@motorola.com> Reviewed-by: Tao Sun <suntao2@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
36d842cd14
commit
d149d0b6d2
2 changed files with 12 additions and 11 deletions
|
|
@ -1790,7 +1790,11 @@ static int abov_remove(struct i2c_client *client)
|
|||
pabovXX_t this = i2c_get_clientdata(client);
|
||||
|
||||
pDevice = this->pDevice;
|
||||
pplatData = client->dev.platform_data;
|
||||
if (this && pDevice) {
|
||||
power_supply_unreg_notifier(&this->ps_notif);
|
||||
cancel_work_sync(&this->fw_update_work.worker);
|
||||
cancel_work_sync(&this->ps_notify_work);
|
||||
#ifdef USE_SENSORS_CLASS
|
||||
sensors_classdev_unregister(&sensors_capsensor_top_cdev);
|
||||
sensors_classdev_unregister(&sensors_capsensor_bottom_cdev);
|
||||
|
|
@ -1803,17 +1807,14 @@ static int abov_remove(struct i2c_client *client)
|
|||
regulator_put(this->board->cap_svdd);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (gpio_is_valid(pplatData ->irq_gpio))
|
||||
gpio_free(pplatData ->irq_gpio);
|
||||
if (this->board->cap_vdd_en) {
|
||||
regulator_disable(this->board->cap_vdd);
|
||||
regulator_put(this->board->cap_vdd);
|
||||
}
|
||||
#ifdef USE_SENSORS_CLASS
|
||||
sensors_classdev_unregister(&sensors_capsensor_top_cdev);
|
||||
sensors_classdev_unregister(&sensors_capsensor_bottom_cdev);
|
||||
#endif
|
||||
sysfs_remove_group(&client->dev.kobj, &abov_attr_group);
|
||||
pplatData = client->dev.platform_data;
|
||||
class_unregister(&capsense_class);
|
||||
if (pplatData && pplatData->exit_platform_hw)
|
||||
pplatData->exit_platform_hw();
|
||||
kfree(this->pDevice);
|
||||
|
|
|
|||
|
|
@ -1360,11 +1360,13 @@ static int sx9325_remove(struct i2c_client *client)
|
|||
psx93XX_t this = i2c_get_clientdata(client);
|
||||
|
||||
pDevice = this->pDevice;
|
||||
pplatData = client->dev.platform_data;
|
||||
if (this && pDevice) {
|
||||
#if defined(CONFIG_FB)
|
||||
fb_unregister_client(&this->fb_notif);
|
||||
#endif
|
||||
power_supply_unreg_notifier(&this->ps_notif);
|
||||
cancel_work_sync(&this->ps_notify_work);
|
||||
|
||||
#ifdef USE_SENSORS_CLASS
|
||||
sensors_classdev_unregister(&sensors_capsensor_top_cdev);
|
||||
|
|
@ -1374,6 +1376,8 @@ static int sx9325_remove(struct i2c_client *client)
|
|||
input_unregister_device(
|
||||
pDevice->pbuttonInformation->input_bottom);
|
||||
|
||||
if (gpio_is_valid(pplatData ->irq_gpio))
|
||||
gpio_free(pplatData ->irq_gpio);
|
||||
if (this->board->cap_svdd_en) {
|
||||
regulator_disable(this->board->cap_svdd);
|
||||
regulator_put(this->board->cap_svdd);
|
||||
|
|
@ -1383,13 +1387,9 @@ static int sx9325_remove(struct i2c_client *client)
|
|||
regulator_disable(this->board->cap_vdd);
|
||||
regulator_put(this->board->cap_vdd);
|
||||
}
|
||||
#endif
|
||||
#ifdef USE_SENSORS_CLASS
|
||||
sensors_classdev_unregister(&sensors_capsensor_top_cdev);
|
||||
sensors_classdev_unregister(&sensors_capsensor_bottom_cdev);
|
||||
#endif
|
||||
sysfs_remove_group(&client->dev.kobj, &sx9325_attr_group);
|
||||
pplatData = client->dev.platform_data;
|
||||
class_unregister(&capsense_class);
|
||||
if (pplatData && pplatData->exit_platform_hw)
|
||||
pplatData->exit_platform_hw();
|
||||
kfree(this->pDevice);
|
||||
|
|
|
|||
Loading…
Reference in a new issue