summaryrefslogtreecommitdiffstats
path: root/drivers/phy/phy-miphy365x.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2015-03-25 10:03:07 +0100
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2015-03-25 10:03:07 +0100
commit3527a86b7ae17c949307d00e1eb7087604bca1b4 (patch)
tree8e8eab905e7e73a3bf2c4d47abd356166533c9db /drivers/phy/phy-miphy365x.c
parentUBI: fix missing brace control flow (diff)
parentLinux 4.0-rc5 (diff)
downloadlinux-3527a86b7ae17c949307d00e1eb7087604bca1b4.tar.xz
linux-3527a86b7ae17c949307d00e1eb7087604bca1b4.zip
Merge tag 'v4.0-rc5' into linux-next
Merge the upstream -rc5 tag because we needed a more up-to-date base our further work.
Diffstat (limited to 'drivers/phy/phy-miphy365x.c')
-rw-r--r--drivers/phy/phy-miphy365x.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/phy/phy-miphy365x.c b/drivers/phy/phy-miphy365x.c
index 6c80154e8bff..51b459db9137 100644
--- a/drivers/phy/phy-miphy365x.c
+++ b/drivers/phy/phy-miphy365x.c
@@ -150,6 +150,7 @@ struct miphy365x_dev {
struct regmap *regmap;
struct mutex miphy_mutex;
struct miphy365x_phy **phys;
+ int nphys;
};
/*
@@ -485,7 +486,7 @@ static struct phy *miphy365x_xlate(struct device *dev,
return ERR_PTR(-EINVAL);
}
- for (index = 0; index < of_get_child_count(dev->of_node); index++)
+ for (index = 0; index < miphy_dev->nphys; index++)
if (phynode == miphy_dev->phys[index]->phy->dev.of_node) {
miphy_phy = miphy_dev->phys[index];
break;
@@ -541,16 +542,15 @@ static int miphy365x_probe(struct platform_device *pdev)
struct miphy365x_dev *miphy_dev;
struct phy_provider *provider;
struct phy *phy;
- int chancount, port = 0;
- int ret;
+ int ret, port = 0;
miphy_dev = devm_kzalloc(&pdev->dev, sizeof(*miphy_dev), GFP_KERNEL);
if (!miphy_dev)
return -ENOMEM;
- chancount = of_get_child_count(np);
- miphy_dev->phys = devm_kzalloc(&pdev->dev, sizeof(phy) * chancount,
- GFP_KERNEL);
+ miphy_dev->nphys = of_get_child_count(np);
+ miphy_dev->phys = devm_kcalloc(&pdev->dev, miphy_dev->nphys,
+ sizeof(*miphy_dev->phys), GFP_KERNEL);
if (!miphy_dev->phys)
return -ENOMEM;