hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
....@@ -1,19 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * dwmac-sunxi.c - Allwinner sunxi DWMAC specific glue layer
34 *
45 * Copyright (C) 2013 Chen-Yu Tsai
56 *
67 * 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.
178 */
189
1910 #include <linux/stmmac.h>
....@@ -27,7 +18,7 @@
2718 #include "stmmac_platform.h"
2819
2920 struct sunxi_priv_data {
30
- int interface;
21
+ phy_interface_t interface;
3122 int clk_enabled;
3223 struct clk *tx_clk;
3324 struct regulator *regulator;
....@@ -127,7 +118,11 @@
127118 goto err_remove_config_dt;
128119 }
129120
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
+ }
131126
132127 gmac->tx_clk = devm_clk_get(dev, "allwinner_gmac_tx");
133128 if (IS_ERR(gmac->tx_clk)) {