OSDN Git Service

phy: berlin-sata: Use devm_kcalloc at appropriate place
authorAxel Lin <axel.lin@ingics.com>
Thu, 5 Mar 2015 01:40:41 +0000 (09:40 +0800)
committerKishon Vijay Abraham I <kishon@ti.com>
Tue, 10 Mar 2015 08:42:27 +0000 (14:12 +0530)
Prefer devm_kcalloc over devm_kzalloc with multiply.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
drivers/phy/phy-berlin-sata.c

index 099eee8..6f3e06d 100644 (file)
@@ -218,7 +218,7 @@ static int phy_berlin_sata_probe(struct platform_device *pdev)
        if (priv->nphys == 0)
                return -ENODEV;
 
-       priv->phys = devm_kzalloc(dev, priv->nphys * sizeof(*priv->phys),
+       priv->phys = devm_kcalloc(dev, priv->nphys, sizeof(*priv->phys),
                                  GFP_KERNEL);
        if (!priv->phys)
                return -ENOMEM;