diff options
author | Deepak Saxena <dsaxena@plexity.net> | 2005-10-17 17:07:05 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-10-28 17:02:12 -0400 |
commit | 2286066faf51890e49ad61e2ceab683666cd9108 (patch) | |
tree | fc9e7dc7a898e80485ea25065ff9143ec0e6407e /drivers/i2c | |
parent | 4d4e5ce8648561b964699afb2df5e7268a84599b (diff) |
[PATCH] i2c: kzalloc conversion, ixp bus drivers
Use kzalloc instead of kmalloc+memzero in the ixp2000 and ixp4xx
I2C bus drivers.
Signed-off-by: Deepak Saxena <dsaxena@mvista.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-ixp2000.c | 3 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-ixp4xx.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-ixp2000.c b/drivers/i2c/busses/i2c-ixp2000.c index c3292dc743f1..42016ee6ef13 100644 --- a/drivers/i2c/busses/i2c-ixp2000.c +++ b/drivers/i2c/busses/i2c-ixp2000.c | |||
@@ -106,11 +106,10 @@ static int ixp2000_i2c_probe(struct device *dev) | |||
106 | struct platform_device *plat_dev = to_platform_device(dev); | 106 | struct platform_device *plat_dev = to_platform_device(dev); |
107 | struct ixp2000_i2c_pins *gpio = plat_dev->dev.platform_data; | 107 | struct ixp2000_i2c_pins *gpio = plat_dev->dev.platform_data; |
108 | struct ixp2000_i2c_data *drv_data = | 108 | struct ixp2000_i2c_data *drv_data = |
109 | kmalloc(sizeof(struct ixp2000_i2c_data), GFP_KERNEL); | 109 | kzalloc(sizeof(struct ixp2000_i2c_data), GFP_KERNEL); |
110 | 110 | ||
111 | if (!drv_data) | 111 | if (!drv_data) |
112 | return -ENOMEM; | 112 | return -ENOMEM; |
113 | memzero(drv_data, sizeof(*drv_data)); | ||
114 | drv_data->gpio_pins = gpio; | 113 | drv_data->gpio_pins = gpio; |
115 | 114 | ||
116 | drv_data->algo_data.data = gpio; | 115 | drv_data->algo_data.data = gpio; |
diff --git a/drivers/i2c/busses/i2c-ixp4xx.c b/drivers/i2c/busses/i2c-ixp4xx.c index 3169280c25a6..69303ab65e04 100644 --- a/drivers/i2c/busses/i2c-ixp4xx.c +++ b/drivers/i2c/busses/i2c-ixp4xx.c | |||
@@ -107,12 +107,11 @@ static int ixp4xx_i2c_probe(struct device *dev) | |||
107 | struct platform_device *plat_dev = to_platform_device(dev); | 107 | struct platform_device *plat_dev = to_platform_device(dev); |
108 | struct ixp4xx_i2c_pins *gpio = plat_dev->dev.platform_data; | 108 | struct ixp4xx_i2c_pins *gpio = plat_dev->dev.platform_data; |
109 | struct ixp4xx_i2c_data *drv_data = | 109 | struct ixp4xx_i2c_data *drv_data = |
110 | kmalloc(sizeof(struct ixp4xx_i2c_data), GFP_KERNEL); | 110 | kzalloc(sizeof(struct ixp4xx_i2c_data), GFP_KERNEL); |
111 | 111 | ||
112 | if(!drv_data) | 112 | if(!drv_data) |
113 | return -ENOMEM; | 113 | return -ENOMEM; |
114 | 114 | ||
115 | memzero(drv_data, sizeof(struct ixp4xx_i2c_data)); | ||
116 | drv_data->gpio_pins = gpio; | 115 | drv_data->gpio_pins = gpio; |
117 | 116 | ||
118 | /* | 117 | /* |