diff options
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/stmmac_main.c')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index d5ebaf62d12f..a2b45f6ac43e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | |||
@@ -232,7 +232,7 @@ static void stmmac_clk_csr_set(struct stmmac_priv *priv) | |||
232 | priv->clk_csr = STMMAC_CSR_100_150M; | 232 | priv->clk_csr = STMMAC_CSR_100_150M; |
233 | else if ((clk_rate >= CSR_F_150M) && (clk_rate < CSR_F_250M)) | 233 | else if ((clk_rate >= CSR_F_150M) && (clk_rate < CSR_F_250M)) |
234 | priv->clk_csr = STMMAC_CSR_150_250M; | 234 | priv->clk_csr = STMMAC_CSR_150_250M; |
235 | else if ((clk_rate >= CSR_F_250M) && (clk_rate < CSR_F_300M)) | 235 | else if ((clk_rate >= CSR_F_250M) && (clk_rate <= CSR_F_300M)) |
236 | priv->clk_csr = STMMAC_CSR_250_300M; | 236 | priv->clk_csr = STMMAC_CSR_250_300M; |
237 | } | 237 | } |
238 | 238 | ||
@@ -3613,6 +3613,7 @@ static int stmmac_change_mtu(struct net_device *dev, int new_mtu) | |||
3613 | { | 3613 | { |
3614 | struct stmmac_priv *priv = netdev_priv(dev); | 3614 | struct stmmac_priv *priv = netdev_priv(dev); |
3615 | int txfifosz = priv->plat->tx_fifo_size; | 3615 | int txfifosz = priv->plat->tx_fifo_size; |
3616 | const int mtu = new_mtu; | ||
3616 | 3617 | ||
3617 | if (txfifosz == 0) | 3618 | if (txfifosz == 0) |
3618 | txfifosz = priv->dma_cap.tx_fifo_size; | 3619 | txfifosz = priv->dma_cap.tx_fifo_size; |
@@ -3630,7 +3631,7 @@ static int stmmac_change_mtu(struct net_device *dev, int new_mtu) | |||
3630 | if ((txfifosz < new_mtu) || (new_mtu > BUF_SIZE_16KiB)) | 3631 | if ((txfifosz < new_mtu) || (new_mtu > BUF_SIZE_16KiB)) |
3631 | return -EINVAL; | 3632 | return -EINVAL; |
3632 | 3633 | ||
3633 | dev->mtu = new_mtu; | 3634 | dev->mtu = mtu; |
3634 | 3635 | ||
3635 | netdev_update_features(dev); | 3636 | netdev_update_features(dev); |
3636 | 3637 | ||
@@ -4549,7 +4550,7 @@ static int __init stmmac_cmdline_opt(char *str) | |||
4549 | char *opt; | 4550 | char *opt; |
4550 | 4551 | ||
4551 | if (!str || !*str) | 4552 | if (!str || !*str) |
4552 | return -EINVAL; | 4553 | return 1; |
4553 | while ((opt = strsep(&str, ",")) != NULL) { | 4554 | while ((opt = strsep(&str, ",")) != NULL) { |
4554 | if (!strncmp(opt, "debug:", 6)) { | 4555 | if (!strncmp(opt, "debug:", 6)) { |
4555 | if (kstrtoint(opt + 6, 0, &debug)) | 4556 | if (kstrtoint(opt + 6, 0, &debug)) |
@@ -4580,11 +4581,11 @@ static int __init stmmac_cmdline_opt(char *str) | |||
4580 | goto err; | 4581 | goto err; |
4581 | } | 4582 | } |
4582 | } | 4583 | } |
4583 | return 0; | 4584 | return 1; |
4584 | 4585 | ||
4585 | err: | 4586 | err: |
4586 | pr_err("%s: ERROR broken module parameter conversion", __func__); | 4587 | pr_err("%s: ERROR broken module parameter conversion", __func__); |
4587 | return -EINVAL; | 4588 | return 1; |
4588 | } | 4589 | } |
4589 | 4590 | ||
4590 | __setup("stmmaceth=", stmmac_cmdline_opt); | 4591 | __setup("stmmaceth=", stmmac_cmdline_opt); |