aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7185.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/saa7185.c')
-rw-r--r--drivers/media/video/saa7185.c6
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);