aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/vpx3220.c
diff options
context:
space:
mode:
authorPanagiotis Issaris <takis@issaris.org>2006-01-11 16:40:56 -0500
committerMauro Carvalho Chehab <mchehab@brturbo.com.br>2006-01-11 16:40:56 -0500
commit7408187d223f63d46a13b6a35b8f96b032c2f623 (patch)
tree425a459f760295de488f57e3f97b034aaa76a78d /drivers/media/video/vpx3220.c
parent0b3af1b6df82cfdb54ae294ed860263011fa0408 (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/vpx3220.c')
-rw-r--r--drivers/media/video/vpx3220.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/media/video/vpx3220.c b/drivers/media/video/vpx3220.c
index 8dcee8b60e21..d0a1e72ea8c4 100644
--- a/drivers/media/video/vpx3220.c
+++ b/drivers/media/video/vpx3220.c
@@ -621,13 +621,11 @@ vpx3220_detect_client (struct i2c_adapter *adapter,
621 (adapter, I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA)) 621 (adapter, I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA))
622 return 0; 622 return 0;
623 623
624 client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); 624 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
625 if (client == NULL) { 625 if (client == NULL) {
626 return -ENOMEM; 626 return -ENOMEM;
627 } 627 }
628 628
629 memset(client, 0, sizeof(struct i2c_client));
630
631 client->addr = address; 629 client->addr = address;
632 client->adapter = adapter; 630 client->adapter = adapter;
633 client->driver = &vpx3220_i2c_driver; 631 client->driver = &vpx3220_i2c_driver;
@@ -675,12 +673,11 @@ vpx3220_detect_client (struct i2c_adapter *adapter,
675 sizeof(I2C_NAME(client))); 673 sizeof(I2C_NAME(client)));
676 } 674 }
677 675
678 decoder = kmalloc(sizeof(struct vpx3220), GFP_KERNEL); 676 decoder = kzalloc(sizeof(struct vpx3220), GFP_KERNEL);
679 if (decoder == NULL) { 677 if (decoder == NULL) {
680 kfree(client); 678 kfree(client);
681 return -ENOMEM; 679 return -ENOMEM;
682 } 680 }
683 memset(decoder, 0, sizeof(struct vpx3220));
684 decoder->norm = VIDEO_MODE_PAL; 681 decoder->norm = VIDEO_MODE_PAL;
685 decoder->input = 0; 682 decoder->input = 0;
686 decoder->enable = 1; 683 decoder->enable = 1;