Currently, of_get_child_count() is called in each iteration of the for loop in
miphy28lp_xlate(). This patch stores the return value of of_get_child_count()
in miphy_dev->nphys and call of_get_child_count() once in miphy28lp_probe().
Signed-off-by: Axel Lin <axel.lin@xxxxxxxxxx>
---
drivers/phy/phy-miphy28lp.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/phy/phy-miphy28lp.c b/drivers/phy/phy-miphy28lp.c
index 9b2848e..d444932 100644
--- a/drivers/phy/phy-miphy28lp.c
+++ b/drivers/phy/phy-miphy28lp.c
@@ -228,6 +228,7 @@ struct miphy28lp_dev {
struct regmap *regmap;
struct mutex miphy_mutex;
struct miphy28lp_phy **phys;
+ int nphys;