aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/sata_dwc_460ex.c
diff options
context:
space:
mode:
authorRakib Mullick <rakib.mullick@gmail.com>2011-07-25 20:12:56 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-25 23:57:13 -0400
commitf35119d6681300ba6d76da53cb1ebc2eed62e77a (patch)
tree0dfd0d1bf9acf3e48791059b50bc68fff01c4db9 /drivers/ata/sata_dwc_460ex.c
parentf1c93e4946ae1cc268729451de6335a7e7d2bea9 (diff)
drivers: use kzalloc/kcalloc instead of 'kmalloc+memset', where possible
Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com> Cc: Jeff Garzik <jgarzik@pobox.com> Cc: David Airlie <airlied@linux.ie> Cc: Tejun Heo <tj@kernel.org> Cc: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/ata/sata_dwc_460ex.c')
-rw-r--r--drivers/ata/sata_dwc_460ex.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c
index b02c4ffa4db0..0a9a774a7e1e 100644
--- a/drivers/ata/sata_dwc_460ex.c
+++ b/drivers/ata/sata_dwc_460ex.c
@@ -1642,13 +1642,12 @@ static int sata_dwc_probe(struct platform_device *ofdev)
1642 const struct ata_port_info *ppi[] = { &pi, NULL }; 1642 const struct ata_port_info *ppi[] = { &pi, NULL };
1643 1643
1644 /* Allocate DWC SATA device */ 1644 /* Allocate DWC SATA device */
1645 hsdev = kmalloc(sizeof(*hsdev), GFP_KERNEL); 1645 hsdev = kzalloc(sizeof(*hsdev), GFP_KERNEL);
1646 if (hsdev == NULL) { 1646 if (hsdev == NULL) {
1647 dev_err(&ofdev->dev, "kmalloc failed for hsdev\n"); 1647 dev_err(&ofdev->dev, "kmalloc failed for hsdev\n");
1648 err = -ENOMEM; 1648 err = -ENOMEM;
1649 goto error; 1649 goto error;
1650 } 1650 }
1651 memset(hsdev, 0, sizeof(*hsdev));
1652 1651
1653 /* Ioremap SATA registers */ 1652 /* Ioremap SATA registers */
1654 base = of_iomap(ofdev->dev.of_node, 0); 1653 base = of_iomap(ofdev->dev.of_node, 0);