| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * dwmac-sti.c - STMicroelectronics DWMAC Specific Glue layer |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2003-2014 STMicroelectronics (R&D) Limited |
|---|
| 5 | 6 | * Author: Srinivas Kandagatla <srinivas.kandagatla@st.com> |
|---|
| 6 | 7 | * Contributors: Giuseppe Cavallaro <peppe.cavallaro@st.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 | 8 | */ |
|---|
| 13 | 9 | |
|---|
| 14 | 10 | #include <linux/kernel.h> |
|---|
| .. | .. |
|---|
| 120 | 116 | #define ETH_PHY_SEL_MII 0x0 |
|---|
| 121 | 117 | |
|---|
| 122 | 118 | struct sti_dwmac { |
|---|
| 123 | | - int interface; /* MII interface */ |
|---|
| 119 | + phy_interface_t interface; /* MII interface */ |
|---|
| 124 | 120 | bool ext_phyclk; /* Clock from external PHY */ |
|---|
| 125 | 121 | u32 tx_retime_src; /* TXCLK Retiming*/ |
|---|
| 126 | 122 | struct clk *clk; /* PHY clock */ |
|---|
| .. | .. |
|---|
| 273 | 269 | return err; |
|---|
| 274 | 270 | } |
|---|
| 275 | 271 | |
|---|
| 276 | | - dwmac->interface = of_get_phy_mode(np); |
|---|
| 272 | + err = of_get_phy_mode(np, &dwmac->interface); |
|---|
| 273 | + if (err && err != -ENODEV) { |
|---|
| 274 | + dev_err(dev, "Can't get phy-mode\n"); |
|---|
| 275 | + return err; |
|---|
| 276 | + } |
|---|
| 277 | + |
|---|
| 277 | 278 | dwmac->regmap = regmap; |
|---|
| 278 | 279 | dwmac->gmac_en = of_property_read_bool(np, "st,gmac_en"); |
|---|
| 279 | 280 | dwmac->ext_phyclk = of_property_read_bool(np, "st,ext-phyclk"); |
|---|