Commit 9e2b8def authored by Mauro Ribeiro's avatar Mauro Ribeiro Committed by Gerrit Code Review

Merge "ODROIDXU3: driver kernel panic fix.(modprobe/modprobe -r)" into odroidxu3-3.10.y

parents ee1b0014 14f5bab1
......@@ -116,7 +116,7 @@ int ina231_misc_probe(struct ina231_sensor *sensor)
struct miscdevice *pmisc;
struct global_sensor *gsensor;
if(!(pmisc = kzalloc(sizeof(struct miscdevice), GFP_KERNEL))) {
if(!(pmisc = devm_kzalloc(&sensor->client->dev, sizeof(struct miscdevice), GFP_KERNEL))) {
printk("INA231 Sensor misc struct malloc error!\n");
return -ENOMEM;
}
......@@ -132,7 +132,7 @@ int ina231_misc_probe(struct ina231_sensor *sensor)
printk("%s : INA231 misc register fail!\n", __func__); return rc;
}
if(!(gsensor = (struct global_sensor *)kmalloc(sizeof(struct global_sensor), GFP_KERNEL))) {
if(!(gsensor = (struct global_sensor *)devm_kzalloc(&sensor->client->dev, sizeof(struct global_sensor), GFP_KERNEL))) {
printk("%s : INA231 global sensor malloc error!\n", __func__);
}
else {
......@@ -155,10 +155,7 @@ void ina231_misc_remove(struct device *dev)
list_for_each(list_head, &SensorList)
{
gsensor = list_entry(list_head, struct global_sensor, list);
kfree(gsensor);
}
kfree(sensor->misc);
}
//[*]--------------------------------------------------------------------------------------------------[*]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment