Commit 63083fd5 authored by Marek Vasut's avatar Marek Vasut Committed by Dmitry Torokhov

Input: ili210x - convert to devm_ functions

Convert the driver to dev-managed allocations.
Signed-off-by: default avatarMarek Vasut <marex@denx.de>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 2fa92839
...@@ -206,12 +206,13 @@ static int ili210x_i2c_probe(struct i2c_client *client, ...@@ -206,12 +206,13 @@ static int ili210x_i2c_probe(struct i2c_client *client,
xmax = panel.finger_max.x_low | (panel.finger_max.x_high << 8); xmax = panel.finger_max.x_low | (panel.finger_max.x_high << 8);
ymax = panel.finger_max.y_low | (panel.finger_max.y_high << 8); ymax = panel.finger_max.y_low | (panel.finger_max.y_high << 8);
priv = kzalloc(sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
input = input_allocate_device(); if (!priv)
if (!priv || !input) { return -ENOMEM;
error = -ENOMEM;
goto err_free_mem; input = devm_input_allocate_device(dev);
} if (!input)
return -ENOMEM;
priv->client = client; priv->client = client;
priv->input = input; priv->input = input;
...@@ -273,8 +274,6 @@ static int ili210x_i2c_probe(struct i2c_client *client, ...@@ -273,8 +274,6 @@ static int ili210x_i2c_probe(struct i2c_client *client,
err_free_irq: err_free_irq:
free_irq(client->irq, priv); free_irq(client->irq, priv);
err_free_mem: err_free_mem:
input_free_device(input);
kfree(priv);
return error; return error;
} }
...@@ -285,8 +284,6 @@ static int ili210x_i2c_remove(struct i2c_client *client) ...@@ -285,8 +284,6 @@ static int ili210x_i2c_remove(struct i2c_client *client)
sysfs_remove_group(&client->dev.kobj, &ili210x_attr_group); sysfs_remove_group(&client->dev.kobj, &ili210x_attr_group);
free_irq(priv->client->irq, priv); free_irq(priv->client->irq, priv);
cancel_delayed_work_sync(&priv->dwork); cancel_delayed_work_sync(&priv->dwork);
input_unregister_device(priv->input);
kfree(priv);
return 0; return 0;
} }
......
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