[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
@ -296,10 +296,9 @@ static int fsl_i2c_probe(struct device *device)
|
||||
|
||||
pdata = (struct fsl_i2c_platform_data *) pdev->dev.platform_data;
|
||||
|
||||
if (!(i2c = kmalloc(sizeof(*i2c), GFP_KERNEL))) {
|
||||
if (!(i2c = kzalloc(sizeof(*i2c), GFP_KERNEL))) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(i2c, 0, sizeof(*i2c));
|
||||
|
||||
i2c->irq = platform_get_irq(pdev, 0);
|
||||
i2c->flags = pdata->device_flags;
|
||||
|
Reference in New Issue
Block a user