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/saa7127.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/saa7127.c')
-rw-r--r-- | drivers/media/video/saa7127.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/video/saa7127.c b/drivers/media/video/saa7127.c index 2009c1bc4720..d14eb3e5c962 100644 --- a/drivers/media/video/saa7127.c +++ b/drivers/media/video/saa7127.c | |||
@@ -689,11 +689,10 @@ static int saa7127_attach(struct i2c_adapter *adapter, int address, int kind) | |||
689 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | 689 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
690 | return 0; | 690 | return 0; |
691 | 691 | ||
692 | client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); | 692 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
693 | if (client == 0) | 693 | if (client == 0) |
694 | return -ENOMEM; | 694 | return -ENOMEM; |
695 | 695 | ||
696 | memset(client, 0, sizeof(struct i2c_client)); | ||
697 | client->addr = address; | 696 | client->addr = address; |
698 | client->adapter = adapter; | 697 | client->adapter = adapter; |
699 | client->driver = &i2c_driver_saa7127; | 698 | client->driver = &i2c_driver_saa7127; |
@@ -712,7 +711,7 @@ static int saa7127_attach(struct i2c_adapter *adapter, int address, int kind) | |||
712 | kfree(client); | 711 | kfree(client); |
713 | return 0; | 712 | return 0; |
714 | } | 713 | } |
715 | state = kmalloc(sizeof(struct saa7127_state), GFP_KERNEL); | 714 | state = kzalloc(sizeof(struct saa7127_state), GFP_KERNEL); |
716 | 715 | ||
717 | if (state == NULL) { | 716 | if (state == NULL) { |
718 | kfree(client); | 717 | kfree(client); |
@@ -720,7 +719,6 @@ static int saa7127_attach(struct i2c_adapter *adapter, int address, int kind) | |||
720 | } | 719 | } |
721 | 720 | ||
722 | i2c_set_clientdata(client, state); | 721 | i2c_set_clientdata(client, state); |
723 | memset(state, 0, sizeof(struct saa7127_state)); | ||
724 | 722 | ||
725 | /* Configure Encoder */ | 723 | /* Configure Encoder */ |
726 | 724 | ||