diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2015-10-03 20:13:17 +0200 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2015-10-09 18:20:53 +0200 |
commit | 19fdb80091a8f3c09b7293bb299f6eb46c6ae070 (patch) | |
tree | e440abd82697fea24a01d3fbb541b6e6418aea66 /drivers/pci | |
parent | PCI: mvebu: Use gpio_set_value_cansleep() (diff) | |
download | linux-19fdb80091a8f3c09b7293bb299f6eb46c6ae070.tar.xz linux-19fdb80091a8f3c09b7293bb299f6eb46c6ae070.zip |
PCI: mvebu: Use devm_kcalloc() to allocate an array
Rather than using devm_kzalloc() and multiplying the element and number,
use the provided devm_kcalloc() helper for this.
Tested-by: Willy Tarreau <w@1wt.eu> (Iomega iConnect Kirkwood, MiraBox Armada 370)
Tested-by: Andrew Lunn <andrew@lunn.ch> (D-Link DIR664 Kirkwood)
Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> (Armada XP GP)
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/host/pci-mvebu.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c index 00467c5a58ac..7282bb06c7a8 100644 --- a/drivers/pci/host/pci-mvebu.c +++ b/drivers/pci/host/pci-mvebu.c @@ -1075,8 +1075,7 @@ static int mvebu_pcie_probe(struct platform_device *pdev) num = of_get_available_child_count(pdev->dev.of_node); - pcie->ports = devm_kzalloc(&pdev->dev, num * - sizeof(struct mvebu_pcie_port), + pcie->ports = devm_kcalloc(&pdev->dev, num, sizeof(*pcie->ports), GFP_KERNEL); if (!pcie->ports) return -ENOMEM; |