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/saa7185.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/saa7185.c')
-rw-r--r-- | drivers/media/video/saa7185.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/video/saa7185.c b/drivers/media/video/saa7185.c index f72a9f796209..3ed0edb870a4 100644 --- a/drivers/media/video/saa7185.c +++ b/drivers/media/video/saa7185.c | |||
@@ -408,21 +408,19 @@ saa7185_detect_client (struct i2c_adapter *adapter, | |||
408 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | 408 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
409 | return 0; | 409 | return 0; |
410 | 410 | ||
411 | client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); | 411 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
412 | if (client == 0) | 412 | if (client == 0) |
413 | return -ENOMEM; | 413 | return -ENOMEM; |
414 | memset(client, 0, sizeof(struct i2c_client)); | ||
415 | client->addr = address; | 414 | client->addr = address; |
416 | client->adapter = adapter; | 415 | client->adapter = adapter; |
417 | client->driver = &i2c_driver_saa7185; | 416 | client->driver = &i2c_driver_saa7185; |
418 | strlcpy(I2C_NAME(client), "saa7185", sizeof(I2C_NAME(client))); | 417 | strlcpy(I2C_NAME(client), "saa7185", sizeof(I2C_NAME(client))); |
419 | 418 | ||
420 | encoder = kmalloc(sizeof(struct saa7185), GFP_KERNEL); | 419 | encoder = kzalloc(sizeof(struct saa7185), GFP_KERNEL); |
421 | if (encoder == NULL) { | 420 | if (encoder == NULL) { |
422 | kfree(client); | 421 | kfree(client); |
423 | return -ENOMEM; | 422 | return -ENOMEM; |
424 | } | 423 | } |
425 | memset(encoder, 0, sizeof(struct saa7185)); | ||
426 | encoder->norm = VIDEO_MODE_NTSC; | 424 | encoder->norm = VIDEO_MODE_NTSC; |
427 | encoder->enable = 1; | 425 | encoder->enable = 1; |
428 | i2c_set_clientdata(client, encoder); | 426 | i2c_set_clientdata(client, encoder); |