Commit 451395f7 authored by Martin Kaiser's avatar Martin Kaiser Committed by David S. Miller

niu: read property length only if we use it

In three places, the driver calls of_get_property and reads the property
length although the length is not used. Update the calls to not request
the length.
Signed-off-by: default avatarMartin Kaiser <martin@kaiser.cx>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d39e8b92
...@@ -9208,7 +9208,7 @@ static int niu_get_of_props(struct niu *np) ...@@ -9208,7 +9208,7 @@ static int niu_get_of_props(struct niu *np)
else else
dp = pci_device_to_OF_node(np->pdev); dp = pci_device_to_OF_node(np->pdev);
phy_type = of_get_property(dp, "phy-type", &prop_len); phy_type = of_get_property(dp, "phy-type", NULL);
if (!phy_type) { if (!phy_type) {
netdev_err(dev, "%pOF: OF node lacks phy-type property\n", dp); netdev_err(dev, "%pOF: OF node lacks phy-type property\n", dp);
return -EINVAL; return -EINVAL;
...@@ -9242,12 +9242,12 @@ static int niu_get_of_props(struct niu *np) ...@@ -9242,12 +9242,12 @@ static int niu_get_of_props(struct niu *np)
return -EINVAL; return -EINVAL;
} }
model = of_get_property(dp, "model", &prop_len); model = of_get_property(dp, "model", NULL);
if (model) if (model)
strcpy(np->vpd.model, model); strcpy(np->vpd.model, model);
if (of_find_property(dp, "hot-swappable-phy", &prop_len)) { if (of_find_property(dp, "hot-swappable-phy", NULL)) {
np->flags |= (NIU_FLAGS_10G | NIU_FLAGS_FIBER | np->flags |= (NIU_FLAGS_10G | NIU_FLAGS_FIBER |
NIU_FLAGS_HOTPLUG_PHY); NIU_FLAGS_HOTPLUG_PHY);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment