mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 14:19:09 -04:00
power: mmi_pl_chg_manager: uninstall driver module
change the remove func of mmi_pl_chg_manager that fixed the panic issue when uninstall mmi_pl_chg_manager driver Change-Id: Ifbac5fadfef8e6e6dbdf4e11a892c27ac7b4cc71 Signed-off-by: xuwt2 <xuwt2@lenovo.com> Reviewed-on: https://gerrit.mot.com/1245080 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Master Yoda Reviewed-by: Jianqi Yang <yangj@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
5f1f249798
commit
9a7380886d
1 changed files with 12 additions and 0 deletions
|
|
@ -2164,6 +2164,12 @@ static void create_sysfs_entries(struct mmi_pl_chg_manager *chip)
|
|||
mmi_pl_err(chip, "Couldn't create factory_pmic_enable\n");
|
||||
}
|
||||
|
||||
static void remove_sysfs_entries(struct mmi_pl_chg_manager *chip)
|
||||
{
|
||||
device_remove_file(chip->dev, &dev_attr_flashc_vbat);
|
||||
device_remove_file(chip->dev, &dev_attr_factory_flashc_enable);
|
||||
device_remove_file(chip->dev, &dev_attr_factory_pmic_enable);
|
||||
}
|
||||
|
||||
static enum power_supply_property mmi_pl_pm_props[] = {
|
||||
POWER_SUPPLY_PROP_PD_CURRENT_MAX,
|
||||
|
|
@ -2387,6 +2393,12 @@ static int mmi_pl_chg_manager_remove(struct platform_device *pdev)
|
|||
{
|
||||
struct mmi_pl_chg_manager *chip = platform_get_drvdata(pdev);
|
||||
|
||||
remove_sysfs_entries(chip);
|
||||
cancel_delayed_work_sync(&chip->mmi_pl_sm_work);
|
||||
|
||||
power_supply_unreg_notifier(&chip->psy_nb);
|
||||
power_supply_unregister(chip->mmi_pl_pm_psy );
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
devm_kfree(&pdev->dev, chip);
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue