From ba9c2e8d15da029ea3051c95e446b2d638ef02e2 Mon Sep 17 00:00:00 2001 From: Deepak Saxena Date: Mon, 17 Oct 2005 23:08:32 +0200 Subject: [PATCH] hwmon: kzalloc conversion Use kzalloc instead of kmalloc+memset in all hardware monitoring drivers. Signed-off-by: Deepak Saxena Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- drivers/hwmon/w83792d.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/hwmon/w83792d.c') diff --git a/drivers/hwmon/w83792d.c b/drivers/hwmon/w83792d.c index 7bbd1888ce9..4be59dbb78c 100644 --- a/drivers/hwmon/w83792d.c +++ b/drivers/hwmon/w83792d.c @@ -1086,11 +1086,10 @@ w83792d_create_subclient(struct i2c_adapter *adapter, int err; struct i2c_client *sub_client; - (*sub_cli) = sub_client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); + (*sub_cli) = sub_client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); if (!(sub_client)) { return -ENOMEM; } - memset(sub_client, 0x00, sizeof(struct i2c_client)); sub_client->addr = 0x48 + addr; i2c_set_clientdata(sub_client, NULL); sub_client->adapter = adapter; @@ -1184,11 +1183,10 @@ w83792d_detect(struct i2c_adapter *adapter, int address, int kind) client structure, even though we cannot fill it completely yet. But it allows us to access w83792d_{read,write}_value. */ - if (!(data = kmalloc(sizeof(struct w83792d_data), GFP_KERNEL))) { + if (!(data = kzalloc(sizeof(struct w83792d_data), GFP_KERNEL))) { err = -ENOMEM; goto ERROR0; } - memset(data, 0, sizeof(struct w83792d_data)); new_client = &data->client; i2c_set_clientdata(new_client, data); -- cgit v1.2.3