mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 12:25:00 -04:00
mmi_thermal_zone: fix compile error
For some verion of linux kernel, kzmalloc could not be used, so we should use a common interface, as dev_zalloc. Or it will meet compile errors on other linux kernel version. Change-Id: I2c248b701ace03bc249db036a38739672eb29652 Reviewed-on: https://gerrit.mot.com/2737220 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Huosheng Liao <liaohs@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
7e9fba0dd5
commit
0fd5d8d4ec
1 changed files with 2 additions and 2 deletions
|
|
@ -72,7 +72,7 @@ static int uevent_generate(struct mmi_sys_temp_dev *data, int index)
|
|||
if ((data->sensor[index].temp / 1000) == (data->sensor[index].pre_temp / 1000))
|
||||
return 0;
|
||||
|
||||
env = kzalloc(sizeof(*env), GFP_KERNEL);
|
||||
env = devm_kzalloc(&data->pdev->dev, sizeof(*env), GFP_KERNEL);
|
||||
if (!env) {
|
||||
dev_err(&data->pdev->dev, "%s: alloc uevent error\n", __func__);
|
||||
return -1;
|
||||
|
|
@ -86,7 +86,7 @@ static int uevent_generate(struct mmi_sys_temp_dev *data, int index)
|
|||
|
||||
ret = kobject_uevent_env(&data->sensor[index].tz_dev->device.kobj, KOBJ_CHANGE, env->envp);
|
||||
|
||||
kfree(env);
|
||||
devm_kfree(&data->pdev->dev, env);
|
||||
|
||||
dev_info(&data->pdev->dev, "trigger uevent index %i, temp %d pre_temp %d",
|
||||
index, data->sensor[index].temp, data->sensor[index].pre_temp);
|
||||
|
|
|
|||
Loading…
Reference in a new issue