[PATCH] i2c: kzalloc conversion, other drivers
Use kzalloc instead of kmalloc+memset in all remaining i2c bus and chip drivers. Signed-off-by: Deepak Saxena <dsaxena@plexity.net> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ba9c2e8d15
commit
5263ebb51e
@@ -672,13 +672,12 @@ static int __devinit iic_probe(struct ocp_device *ocp){
|
||||
printk(KERN_WARNING"ibm-iic%d: missing additional data!\n",
|
||||
ocp->def->index);
|
||||
|
||||
if (!(dev = kmalloc(sizeof(*dev), GFP_KERNEL))){
|
||||
if (!(dev = kzalloc(sizeof(*dev), GFP_KERNEL))) {
|
||||
printk(KERN_CRIT "ibm-iic%d: failed to allocate device data\n",
|
||||
ocp->def->index);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
memset(dev, 0, sizeof(*dev));
|
||||
dev->idx = ocp->def->index;
|
||||
ocp_set_drvdata(ocp, dev);
|
||||
|
||||
|
Reference in New Issue
Block a user