summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>2019-06-15 06:09:31 -0400
committerDavid S. Miller <davem@davemloft.net>2019-06-16 16:53:41 -0400
commitce4ab73ab0c27c6a3853695aa8ec0f453c6329cd (patch)
tree15dd4cf19d7b9d7aabdc8cce4ea5a65cd9205eda
parent7e770b252a62e7498cfa9411018100fd86e56d47 (diff)
net: stmmac: drop the reset delays from struct stmmac_mdio_bus_data
Only OF platforms use the reset delays and these delays are only read in stmmac_mdio_reset(). Move them from struct stmmac_mdio_bus_data to a stack variable inside stmmac_mdio_reset() because that's the only usage of these delays. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c15
-rw-r--r--include/linux/stmmac.h3
2 files changed, 8 insertions, 10 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
index 459ef8afe4fb..c9454cf4f189 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
@@ -252,6 +252,7 @@ int stmmac_mdio_reset(struct mii_bus *bus)
252#ifdef CONFIG_OF 252#ifdef CONFIG_OF
253 if (priv->device->of_node) { 253 if (priv->device->of_node) {
254 struct gpio_desc *reset_gpio; 254 struct gpio_desc *reset_gpio;
255 u32 delays[3];
255 256
256 reset_gpio = devm_gpiod_get_optional(priv->device, 257 reset_gpio = devm_gpiod_get_optional(priv->device,
257 "snps,reset", 258 "snps,reset",
@@ -261,18 +262,18 @@ int stmmac_mdio_reset(struct mii_bus *bus)
261 262
262 device_property_read_u32_array(priv->device, 263 device_property_read_u32_array(priv->device,
263 "snps,reset-delays-us", 264 "snps,reset-delays-us",
264 data->delays, 3); 265 delays, ARRAY_SIZE(delays));
265 266
266 if (data->delays[0]) 267 if (delays[0])
267 msleep(DIV_ROUND_UP(data->delays[0], 1000)); 268 msleep(DIV_ROUND_UP(delays[0], 1000));
268 269
269 gpiod_set_value_cansleep(reset_gpio, 1); 270 gpiod_set_value_cansleep(reset_gpio, 1);
270 if (data->delays[1]) 271 if (delays[1])
271 msleep(DIV_ROUND_UP(data->delays[1], 1000)); 272 msleep(DIV_ROUND_UP(delays[1], 1000));
272 273
273 gpiod_set_value_cansleep(reset_gpio, 0); 274 gpiod_set_value_cansleep(reset_gpio, 0);
274 if (data->delays[2]) 275 if (delays[2])
275 msleep(DIV_ROUND_UP(data->delays[2], 1000)); 276 msleep(DIV_ROUND_UP(delays[2], 1000));
276 } 277 }
277#endif 278#endif
278 279
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index a0cc6fa4965b..7c8328edd501 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -96,9 +96,6 @@ struct stmmac_mdio_bus_data {
96 unsigned int phy_mask; 96 unsigned int phy_mask;
97 int *irqs; 97 int *irqs;
98 int probed_phy_irq; 98 int probed_phy_irq;
99#ifdef CONFIG_OF
100 u32 delays[3];
101#endif
102}; 99};
103 100
104struct stmmac_dma_cfg { 101struct stmmac_dma_cfg {