summaryrefslogtreecommitdiff
path: root/drivers/hwmon/asc7621.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2012-06-02 20:58:02 +0400
committerGuenter Roeck <linux@roeck-us.net>2012-07-22 08:48:40 +0400
commit35bb95a17a1c04ec9620553867f29a336e868707 (patch)
treefe781bf279a204d5f641dfeccb27a4742336e781 /drivers/hwmon/asc7621.c
parent5ff512b458ba7948d22dab0771233cf9b2da0793 (diff)
downloadlinux-35bb95a17a1c04ec9620553867f29a336e868707.tar.xz
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: Guenter Roeck <linux@roeck-us.net> Acked-by: George Joseph <george.joseph@fairview5.com>
Diffstat (limited to 'drivers/hwmon/asc7621.c')
-rw-r--r--drivers/hwmon/asc7621.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/hwmon/asc7621.c b/drivers/hwmon/asc7621.c
index 7caa242915a6..b867aab78049 100644
--- a/drivers/hwmon/asc7621.c
+++ b/drivers/hwmon/asc7621.c
@@ -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))
return -EIO;
- data = kzalloc(sizeof(struct asc7621_data), GFP_KERNEL);
+ data = devm_kzalloc(&client->dev, sizeof(struct asc7621_data),
+ GFP_KERNEL);
if (data == NULL)
return -ENOMEM;
@@ -1143,7 +1144,6 @@ exit_remove:
&(asc7621_params[i].sda.dev_attr));
}
- kfree(data);
return err;
}
@@ -1192,7 +1192,6 @@ static int asc7621_remove(struct i2c_client *client)
&(asc7621_params[i].sda.dev_attr));
}
- kfree(data);
return 0;
}