aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-iop3xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/busses/i2c-iop3xx.c')
-rw-r--r--drivers/i2c/busses/i2c-iop3xx.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c
index 7bd9102db701..9888fae1f37a 100644
--- a/drivers/i2c/busses/i2c-iop3xx.c
+++ b/drivers/i2c/busses/i2c-iop3xx.c
@@ -43,7 +43,7 @@
43#include "i2c-iop3xx.h" 43#include "i2c-iop3xx.h"
44 44
45/* global unit counter */ 45/* global unit counter */
46static int i2c_id = 0; 46static int i2c_id;
47 47
48static inline unsigned char 48static inline unsigned char
49iic_cook_addr(struct i2c_msg *msg) 49iic_cook_addr(struct i2c_msg *msg)
@@ -440,19 +440,17 @@ iop3xx_i2c_probe(struct device *dev)
440 struct i2c_adapter *new_adapter; 440 struct i2c_adapter *new_adapter;
441 struct i2c_algo_iop3xx_data *adapter_data; 441 struct i2c_algo_iop3xx_data *adapter_data;
442 442
443 new_adapter = kmalloc(sizeof(struct i2c_adapter), GFP_KERNEL); 443 new_adapter = kzalloc(sizeof(struct i2c_adapter), GFP_KERNEL);
444 if (!new_adapter) { 444 if (!new_adapter) {
445 ret = -ENOMEM; 445 ret = -ENOMEM;
446 goto out; 446 goto out;
447 } 447 }
448 memset((void*)new_adapter, 0, sizeof(*new_adapter));
449 448
450 adapter_data = kmalloc(sizeof(struct i2c_algo_iop3xx_data), GFP_KERNEL); 449 adapter_data = kzalloc(sizeof(struct i2c_algo_iop3xx_data), GFP_KERNEL);
451 if (!adapter_data) { 450 if (!adapter_data) {
452 ret = -ENOMEM; 451 ret = -ENOMEM;
453 goto free_adapter; 452 goto free_adapter;
454 } 453 }
455 memset((void*)adapter_data, 0, sizeof(*adapter_data));
456 454
457 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 455 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
458 if (!res) { 456 if (!res) {
@@ -525,6 +523,7 @@ out:
525 523
526 524
527static struct device_driver iop3xx_i2c_driver = { 525static struct device_driver iop3xx_i2c_driver = {
526 .owner = THIS_MODULE,
528 .name = "IOP3xx-I2C", 527 .name = "IOP3xx-I2C",
529 .bus = &platform_bus_type, 528 .bus = &platform_bus_type,
530 .probe = iop3xx_i2c_probe, 529 .probe = iop3xx_i2c_probe,