.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0+ |
---|
1 | 2 | /* Xilinx GMII2RGMII Converter driver |
---|
2 | 3 | * |
---|
3 | 4 | * Copyright (C) 2016 Xilinx, Inc. |
---|
.. | .. |
---|
8 | 9 | * |
---|
9 | 10 | * Description: |
---|
10 | 11 | * This driver is developed for Xilinx GMII2RGMII Converter |
---|
11 | | - * |
---|
12 | | - * This program is free software: you can redistribute it and/or modify |
---|
13 | | - * it under the terms of the GNU General Public License as published by |
---|
14 | | - * the Free Software Foundation, either version 2 of the License, or |
---|
15 | | - * (at your option) any later version. |
---|
16 | | - * |
---|
17 | | - * This program is distributed in the hope that it will be useful, |
---|
18 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
19 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
20 | | - * GNU General Public License for more details. |
---|
21 | 12 | */ |
---|
22 | 13 | #include <linux/module.h> |
---|
23 | 14 | #include <linux/kernel.h> |
---|
.. | .. |
---|
38 | 29 | |
---|
39 | 30 | static int xgmiitorgmii_read_status(struct phy_device *phydev) |
---|
40 | 31 | { |
---|
41 | | - struct gmii2rgmii *priv = phydev->priv; |
---|
| 32 | + struct gmii2rgmii *priv = mdiodev_get_drvdata(&phydev->mdio); |
---|
42 | 33 | struct mii_bus *bus = priv->mdio->bus; |
---|
43 | 34 | int addr = priv->mdio->addr; |
---|
44 | 35 | u16 val = 0; |
---|
.. | .. |
---|
91 | 82 | |
---|
92 | 83 | if (!priv->phy_dev->drv) { |
---|
93 | 84 | dev_info(dev, "Attached phy not ready\n"); |
---|
| 85 | + put_device(&priv->phy_dev->mdio.dev); |
---|
94 | 86 | return -EPROBE_DEFER; |
---|
95 | 87 | } |
---|
96 | 88 | |
---|
.. | .. |
---|
99 | 91 | memcpy(&priv->conv_phy_drv, priv->phy_dev->drv, |
---|
100 | 92 | sizeof(struct phy_driver)); |
---|
101 | 93 | priv->conv_phy_drv.read_status = xgmiitorgmii_read_status; |
---|
102 | | - priv->phy_dev->priv = priv; |
---|
| 94 | + mdiodev_set_drvdata(&priv->phy_dev->mdio, priv); |
---|
103 | 95 | priv->phy_dev->drv = &priv->conv_phy_drv; |
---|
104 | 96 | |
---|
105 | 97 | return 0; |
---|