.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * dwmac-sunxi.c - Allwinner sunxi DWMAC specific glue layer |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2013 Chen-Yu Tsai |
---|
5 | 6 | * |
---|
6 | 7 | * Chen-Yu Tsai <wens@csie.org> |
---|
7 | | - * |
---|
8 | | - * This program is free software; you can redistribute it and/or modify |
---|
9 | | - * it under the terms of the GNU General Public License as published by |
---|
10 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
11 | | - * (at your option) any later version. |
---|
12 | | - * |
---|
13 | | - * This program is distributed in the hope that it will be useful, |
---|
14 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
16 | | - * GNU General Public License for more details. |
---|
17 | 8 | */ |
---|
18 | 9 | |
---|
19 | 10 | #include <linux/stmmac.h> |
---|
.. | .. |
---|
27 | 18 | #include "stmmac_platform.h" |
---|
28 | 19 | |
---|
29 | 20 | struct sunxi_priv_data { |
---|
30 | | - int interface; |
---|
| 21 | + phy_interface_t interface; |
---|
31 | 22 | int clk_enabled; |
---|
32 | 23 | struct clk *tx_clk; |
---|
33 | 24 | struct regulator *regulator; |
---|
.. | .. |
---|
127 | 118 | goto err_remove_config_dt; |
---|
128 | 119 | } |
---|
129 | 120 | |
---|
130 | | - gmac->interface = of_get_phy_mode(dev->of_node); |
---|
| 121 | + ret = of_get_phy_mode(dev->of_node, &gmac->interface); |
---|
| 122 | + if (ret && ret != -ENODEV) { |
---|
| 123 | + dev_err(dev, "Can't get phy-mode\n"); |
---|
| 124 | + goto err_remove_config_dt; |
---|
| 125 | + } |
---|
131 | 126 | |
---|
132 | 127 | gmac->tx_clk = devm_clk_get(dev, "allwinner_gmac_tx"); |
---|
133 | 128 | if (IS_ERR(gmac->tx_clk)) { |
---|