diff options
author | David S. Miller <davem@davemloft.net> | 2016-05-17 14:49:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-05-17 14:49:24 -0400 |
commit | c606b4999b8b11600baabab6a18fb02d296569a3 (patch) | |
tree | 19341e96b2a78641fc45179de9f8e3e18e229f6c | |
parent | 27896c83fe94e2190f121a2fdbffffbf1d83d573 (diff) |
Revert "phy dp83867: Make rgmii parameters optional"
This reverts commit 81003bc924bac0a99bfdc2869f5dff5a87aa4a3d.
Developers have asked me to revert this for now.
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/phy/dp83867.c | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c index 1b01680987c4..94cc278b3136 100644 --- a/drivers/net/phy/dp83867.c +++ b/drivers/net/phy/dp83867.c | |||
@@ -65,7 +65,6 @@ struct dp83867_private { | |||
65 | int rx_id_delay; | 65 | int rx_id_delay; |
66 | int tx_id_delay; | 66 | int tx_id_delay; |
67 | int fifo_depth; | 67 | int fifo_depth; |
68 | int values_are_sane; | ||
69 | }; | 68 | }; |
70 | 69 | ||
71 | static int dp83867_ack_interrupt(struct phy_device *phydev) | 70 | static int dp83867_ack_interrupt(struct phy_device *phydev) |
@@ -114,30 +113,15 @@ static int dp83867_of_init(struct phy_device *phydev) | |||
114 | ret = of_property_read_u32(of_node, "ti,rx-internal-delay", | 113 | ret = of_property_read_u32(of_node, "ti,rx-internal-delay", |
115 | &dp83867->rx_id_delay); | 114 | &dp83867->rx_id_delay); |
116 | if (ret) | 115 | if (ret) |
117 | goto invalid_dt; | 116 | return ret; |
118 | 117 | ||
119 | ret = of_property_read_u32(of_node, "ti,tx-internal-delay", | 118 | ret = of_property_read_u32(of_node, "ti,tx-internal-delay", |
120 | &dp83867->tx_id_delay); | 119 | &dp83867->tx_id_delay); |
121 | if (ret) | 120 | if (ret) |
122 | goto invalid_dt; | 121 | return ret; |
123 | 122 | ||
124 | ret = of_property_read_u32(of_node, "ti,fifo-depth", | 123 | return of_property_read_u32(of_node, "ti,fifo-depth", |
125 | &dp83867->fifo_depth); | 124 | &dp83867->fifo_depth); |
126 | if (ret) | ||
127 | goto invalid_dt; | ||
128 | |||
129 | dp83867->values_are_sane = 1; | ||
130 | |||
131 | return 0; | ||
132 | |||
133 | invalid_dt: | ||
134 | phydev_err(phydev, "missing properties in device tree"); | ||
135 | |||
136 | /* | ||
137 | * We can still run with a broken dt by not using any of the optional | ||
138 | * parameters, so just don't set dp83867->values_are_sane. | ||
139 | */ | ||
140 | return 0; | ||
141 | } | 125 | } |
142 | #else | 126 | #else |
143 | static int dp83867_of_init(struct phy_device *phydev) | 127 | static int dp83867_of_init(struct phy_device *phydev) |
@@ -166,15 +150,6 @@ static int dp83867_config_init(struct phy_device *phydev) | |||
166 | dp83867 = (struct dp83867_private *)phydev->priv; | 150 | dp83867 = (struct dp83867_private *)phydev->priv; |
167 | } | 151 | } |
168 | 152 | ||
169 | /* | ||
170 | * With no or broken device tree, we don't have the values that we would | ||
171 | * want to configure the phy with. In that case, cross our fingers and | ||
172 | * assume that firmware did everything correctly for us or that we don't | ||
173 | * need them. | ||
174 | */ | ||
175 | if (!dp83867->values_are_sane) | ||
176 | return 0; | ||
177 | |||
178 | if (phy_interface_is_rgmii(phydev)) { | 153 | if (phy_interface_is_rgmii(phydev)) { |
179 | ret = phy_write(phydev, MII_DP83867_PHYCTRL, | 154 | ret = phy_write(phydev, MII_DP83867_PHYCTRL, |
180 | (dp83867->fifo_depth << DP83867_PHYCR_FIFO_DEPTH_SHIFT)); | 155 | (dp83867->fifo_depth << DP83867_PHYCR_FIFO_DEPTH_SHIFT)); |