aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/chips/max6875.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/chips/max6875.c')
-rw-r--r--drivers/i2c/chips/max6875.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/i2c/chips/max6875.c b/drivers/i2c/chips/max6875.c
index 9e1aeb69abf9..b376a006883c 100644
--- a/drivers/i2c/chips/max6875.c
+++ b/drivers/i2c/chips/max6875.c
@@ -179,16 +179,14 @@ static int max6875_detect(struct i2c_adapter *adapter, int address, int kind)
if (address & 1)
return 0;
- if (!(data = kmalloc(sizeof(struct max6875_data), GFP_KERNEL)))
+ if (!(data = kzalloc(sizeof(struct max6875_data), GFP_KERNEL)))
return -ENOMEM;
- memset(data, 0, sizeof(struct max6875_data));
/* A fake client is created on the odd address */
- if (!(fake_client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL))) {
+ if (!(fake_client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL))) {
err = -ENOMEM;
goto exit_kfree1;
}
- memset(fake_client, 0, sizeof(struct i2c_client));
/* Init real i2c_client */
real_client = &data->client;