diff options
author | Panagiotis Issaris <takis@issaris.org> | 2006-01-11 16:40:56 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@brturbo.com.br> | 2006-01-11 16:40:56 -0500 |
commit | 7408187d223f63d46a13b6a35b8f96b032c2f623 (patch) | |
tree | 425a459f760295de488f57e3f97b034aaa76a78d /drivers/media/video/saa7115.c | |
parent | 0b3af1b6df82cfdb54ae294ed860263011fa0408 (diff) |
V4L/DVB (3344a): Conversions from kmalloc+memset to k(z|c)alloc
Conversions from kmalloc+memset to k(z|c)alloc.
Signed-off-by: Panagiotis Issaris <takis@issaris.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/saa7115.c')
-rw-r--r-- | drivers/media/video/saa7115.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c index 4a4bc69fb0e9..ab8b4bcb5dd6 100644 --- a/drivers/media/video/saa7115.c +++ b/drivers/media/video/saa7115.c | |||
@@ -1249,10 +1249,9 @@ static int saa7115_attach(struct i2c_adapter *adapter, int address, int kind) | |||
1249 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | 1249 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
1250 | return 0; | 1250 | return 0; |
1251 | 1251 | ||
1252 | client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); | 1252 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
1253 | if (client == 0) | 1253 | if (client == 0) |
1254 | return -ENOMEM; | 1254 | return -ENOMEM; |
1255 | memset(client, 0, sizeof(struct i2c_client)); | ||
1256 | client->addr = address; | 1255 | client->addr = address; |
1257 | client->adapter = adapter; | 1256 | client->adapter = adapter; |
1258 | client->driver = &i2c_driver_saa7115; | 1257 | client->driver = &i2c_driver_saa7115; |
@@ -1272,13 +1271,12 @@ static int saa7115_attach(struct i2c_adapter *adapter, int address, int kind) | |||
1272 | } | 1271 | } |
1273 | v4l_info(client, "saa711%d found @ 0x%x (%s)\n", chip_id, address << 1, adapter->name); | 1272 | v4l_info(client, "saa711%d found @ 0x%x (%s)\n", chip_id, address << 1, adapter->name); |
1274 | 1273 | ||
1275 | state = kmalloc(sizeof(struct saa7115_state), GFP_KERNEL); | 1274 | state = kzalloc(sizeof(struct saa7115_state), GFP_KERNEL); |
1276 | i2c_set_clientdata(client, state); | 1275 | i2c_set_clientdata(client, state); |
1277 | if (state == NULL) { | 1276 | if (state == NULL) { |
1278 | kfree(client); | 1277 | kfree(client); |
1279 | return -ENOMEM; | 1278 | return -ENOMEM; |
1280 | } | 1279 | } |
1281 | memset(state, 0, sizeof(struct saa7115_state)); | ||
1282 | state->std = V4L2_STD_NTSC; | 1280 | state->std = V4L2_STD_NTSC; |
1283 | state->input = -1; | 1281 | state->input = -1; |
1284 | state->enable = 1; | 1282 | state->enable = 1; |