Commit 35bb95a1 authored by Guenter Roeck's avatar Guenter Roeck

hwmon: (asc7621) Convert to use devm_ functions

Convert to use devm_ functions to reduce code size and simplify the code.

Cc: George Joseph <george.joseph@fairview5.com>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Acked-by: default avatarGeorge Joseph <george.joseph@fairview5.com>
parent 5ff512b4
...@@ -1109,7 +1109,8 @@ asc7621_probe(struct i2c_client *client, const struct i2c_device_id *id) ...@@ -1109,7 +1109,8 @@ asc7621_probe(struct i2c_client *client, const struct i2c_device_id *id)
if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
return -EIO; return -EIO;
data = kzalloc(sizeof(struct asc7621_data), GFP_KERNEL); data = devm_kzalloc(&client->dev, sizeof(struct asc7621_data),
GFP_KERNEL);
if (data == NULL) if (data == NULL)
return -ENOMEM; return -ENOMEM;
...@@ -1143,7 +1144,6 @@ asc7621_probe(struct i2c_client *client, const struct i2c_device_id *id) ...@@ -1143,7 +1144,6 @@ asc7621_probe(struct i2c_client *client, const struct i2c_device_id *id)
&(asc7621_params[i].sda.dev_attr)); &(asc7621_params[i].sda.dev_attr));
} }
kfree(data);
return err; return err;
} }
...@@ -1192,7 +1192,6 @@ static int asc7621_remove(struct i2c_client *client) ...@@ -1192,7 +1192,6 @@ static int asc7621_remove(struct i2c_client *client)
&(asc7621_params[i].sda.dev_attr)); &(asc7621_params[i].sda.dev_attr));
} }
kfree(data);
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