hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/net/ethernet/arc/emac_arc.c
....@@ -1,19 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /**
2
- * emac_arc.c - ARC EMAC specific glue layer
3
+ * DOC: emac_arc.c - ARC EMAC specific glue layer
34 *
45 * Copyright (C) 2014 Romain Perier
56 *
67 * Romain Perier <romain.perier@gmail.com>
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/etherdevice.h>
....@@ -24,14 +15,14 @@
2415 #include "emac.h"
2516
2617 #define DRV_NAME "emac_arc"
27
-#define DRV_VERSION "1.0"
2818
2919 static int emac_arc_probe(struct platform_device *pdev)
3020 {
3121 struct device *dev = &pdev->dev;
32
- struct net_device *ndev;
3322 struct arc_emac_priv *priv;
34
- int interface, err;
23
+ phy_interface_t interface;
24
+ struct net_device *ndev;
25
+ int err;
3526
3627 if (!dev->of_node)
3728 return -ENODEV;
....@@ -44,11 +35,14 @@
4435
4536 priv = netdev_priv(ndev);
4637 priv->drv_name = DRV_NAME;
47
- priv->drv_version = DRV_VERSION;
4838
49
- interface = of_get_phy_mode(dev->of_node);
50
- if (interface < 0)
51
- interface = PHY_INTERFACE_MODE_MII;
39
+ err = of_get_phy_mode(dev->of_node, &interface);
40
+ if (err) {
41
+ if (err == -ENODEV)
42
+ interface = PHY_INTERFACE_MODE_MII;
43
+ else
44
+ goto out_netdev;
45
+ }
5246
5347 priv->clk = devm_clk_get(dev, "hclk");
5448 if (IS_ERR(priv->clk)) {