.. | .. |
---|
189 | 189 | static int ipq806x_gmac_of_parse(struct ipq806x_gmac *gmac) |
---|
190 | 190 | { |
---|
191 | 191 | struct device *dev = &gmac->pdev->dev; |
---|
| 192 | + int ret; |
---|
192 | 193 | |
---|
193 | | - gmac->phy_mode = of_get_phy_mode(dev->of_node); |
---|
194 | | - if ((int)gmac->phy_mode < 0) { |
---|
| 194 | + ret = of_get_phy_mode(dev->of_node, &gmac->phy_mode); |
---|
| 195 | + if (ret) { |
---|
195 | 196 | dev_err(dev, "missing phy mode property\n"); |
---|
196 | 197 | return -EINVAL; |
---|
197 | 198 | } |
---|
.. | .. |
---|
288 | 289 | val &= ~NSS_COMMON_GMAC_CTL_PHY_IFACE_SEL; |
---|
289 | 290 | break; |
---|
290 | 291 | default: |
---|
291 | | - dev_err(&pdev->dev, "Unsupported PHY mode: \"%s\"\n", |
---|
292 | | - phy_modes(gmac->phy_mode)); |
---|
293 | | - err = -EINVAL; |
---|
294 | | - goto err_remove_config_dt; |
---|
| 292 | + goto err_unsupported_phy; |
---|
295 | 293 | } |
---|
296 | 294 | regmap_write(gmac->nss_common, NSS_COMMON_GMAC_CTL(gmac->id), val); |
---|
297 | 295 | |
---|
.. | .. |
---|
308 | 306 | NSS_COMMON_CLK_SRC_CTRL_OFFSET(gmac->id); |
---|
309 | 307 | break; |
---|
310 | 308 | default: |
---|
311 | | - dev_err(&pdev->dev, "Unsupported PHY mode: \"%s\"\n", |
---|
312 | | - phy_modes(gmac->phy_mode)); |
---|
313 | | - err = -EINVAL; |
---|
314 | | - goto err_remove_config_dt; |
---|
| 309 | + goto err_unsupported_phy; |
---|
315 | 310 | } |
---|
316 | 311 | regmap_write(gmac->nss_common, NSS_COMMON_CLK_SRC_CTRL, val); |
---|
317 | 312 | |
---|
.. | .. |
---|
328 | 323 | NSS_COMMON_CLK_GATE_GMII_TX_EN(gmac->id); |
---|
329 | 324 | break; |
---|
330 | 325 | default: |
---|
331 | | - /* We don't get here; the switch above will have errored out */ |
---|
332 | | - unreachable(); |
---|
| 326 | + goto err_unsupported_phy; |
---|
333 | 327 | } |
---|
334 | 328 | regmap_write(gmac->nss_common, NSS_COMMON_CLK_GATE, val); |
---|
335 | 329 | |
---|
.. | .. |
---|
351 | 345 | plat_dat->bsp_priv = gmac; |
---|
352 | 346 | plat_dat->fix_mac_speed = ipq806x_gmac_fix_mac_speed; |
---|
353 | 347 | plat_dat->multicast_filter_bins = 0; |
---|
| 348 | + plat_dat->tx_fifo_size = 8192; |
---|
| 349 | + plat_dat->rx_fifo_size = 8192; |
---|
354 | 350 | |
---|
355 | 351 | err = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); |
---|
356 | 352 | if (err) |
---|
.. | .. |
---|
358 | 354 | |
---|
359 | 355 | return 0; |
---|
360 | 356 | |
---|
| 357 | +err_unsupported_phy: |
---|
| 358 | + dev_err(&pdev->dev, "Unsupported PHY mode: \"%s\"\n", |
---|
| 359 | + phy_modes(gmac->phy_mode)); |
---|
| 360 | + err = -EINVAL; |
---|
| 361 | + |
---|
361 | 362 | err_remove_config_dt: |
---|
362 | 363 | stmmac_remove_config_dt(pdev, plat_dat); |
---|
363 | 364 | |
---|