forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/net/ethernet/arc/emac_rockchip.c
....@@ -1,17 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /**
23 * emac-rockchip.c - Rockchip EMAC specific glue layer
34 *
45 * Copyright (C) 2014 Romain Perier <romain.perier@gmail.com>
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
156 */
167
178 #include <linux/etherdevice.h>
....@@ -25,7 +16,6 @@
2516 #include "emac.h"
2617
2718 #define DRV_NAME "rockchip_emac"
28
-#define DRV_VERSION "1.1"
2919
3020 struct emac_rockchip_soc_data {
3121 unsigned int grf_offset;
....@@ -106,8 +96,9 @@
10696 struct net_device *ndev;
10797 struct rockchip_priv_data *priv;
10898 const struct of_device_id *match;
99
+ phy_interface_t interface;
109100 u32 data;
110
- int err, interface;
101
+ int err;
111102
112103 if (!pdev->dev.of_node)
113104 return -ENODEV;
....@@ -120,10 +111,11 @@
120111
121112 priv = netdev_priv(ndev);
122113 priv->emac.drv_name = DRV_NAME;
123
- priv->emac.drv_version = DRV_VERSION;
124114 priv->emac.set_mac_speed = emac_rockchip_set_mac_speed;
125115
126
- interface = of_get_phy_mode(dev->of_node);
116
+ err = of_get_phy_mode(dev->of_node, &interface);
117
+ if (err)
118
+ goto out_netdev;
127119
128120 /* RK3036/RK3066/RK3188 SoCs only support RMII */
129121 if (interface != PHY_INTERFACE_MODE_RMII) {