[ARM] Convert kmalloc+memset to kzalloc

Convert all uses of kmalloc followed by memset to use kzalloc instead.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
Russell King
2006-03-20 19:46:41 +00:00
committed by Russell King
parent 18ec5c7312
commit d2a02b93cf
14 changed files with 18 additions and 48 deletions

View File

@@ -501,12 +501,11 @@ locomo_init_one_child(struct locomo *lchip, struct locomo_dev_info *info)
struct locomo_dev *dev;
int ret;
dev = kmalloc(sizeof(struct locomo_dev), GFP_KERNEL);
dev = kzalloc(sizeof(struct locomo_dev), GFP_KERNEL);
if (!dev) {
ret = -ENOMEM;
goto out;
}
memset(dev, 0, sizeof(struct locomo_dev));
strncpy(dev->dev.bus_id,info->name,sizeof(dev->dev.bus_id));
/*
@@ -664,12 +663,10 @@ __locomo_probe(struct device *me, struct resource *mem, int irq)
unsigned long r;
int i, ret = -ENODEV;
lchip = kmalloc(sizeof(struct locomo), GFP_KERNEL);
lchip = kzalloc(sizeof(struct locomo), GFP_KERNEL);
if (!lchip)
return -ENOMEM;
memset(lchip, 0, sizeof(struct locomo));
spin_lock_init(&lchip->lock);
lchip->dev = me;

View File

@@ -541,12 +541,11 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
struct sa1111_dev *dev;
int ret;
dev = kmalloc(sizeof(struct sa1111_dev), GFP_KERNEL);
dev = kzalloc(sizeof(struct sa1111_dev), GFP_KERNEL);
if (!dev) {
ret = -ENOMEM;
goto out;
}
memset(dev, 0, sizeof(struct sa1111_dev));
snprintf(dev->dev.bus_id, sizeof(dev->dev.bus_id),
"%4.4lx", info->offset);
@@ -621,12 +620,10 @@ __sa1111_probe(struct device *me, struct resource *mem, int irq)
unsigned int has_devs, val;
int i, ret = -ENODEV;
sachip = kmalloc(sizeof(struct sa1111), GFP_KERNEL);
sachip = kzalloc(sizeof(struct sa1111), GFP_KERNEL);
if (!sachip)
return -ENOMEM;
memset(sachip, 0, sizeof(struct sa1111));
sachip->clk = clk_get(me, "GPIO27_CLK");
if (!sachip->clk) {
ret = PTR_ERR(sachip->clk);

View File

@@ -132,12 +132,10 @@ int __init scoop_probe(struct platform_device *pdev)
if (!mem)
return -EINVAL;
devptr = kmalloc(sizeof(struct scoop_dev), GFP_KERNEL);
devptr = kzalloc(sizeof(struct scoop_dev), GFP_KERNEL);
if (!devptr)
return -ENOMEM;
return -ENOMEM;
memset(devptr, 0, sizeof(struct scoop_dev));
spin_lock_init(&devptr->scoop_lock);
inf = pdev->dev.platform_data;