From: Arun Ramadoss <arun.ramadoss@microchip.com>
To: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
Jakub Kicinski <kuba@kernel.org>,
"David S . Miller" <davem@davemloft.net>,
<UNGLinuxDriver@microchip.com>
Subject: [RFC PATCH net-next 2/2] net: phy: lan87xx: use genphy_read_master_slave in read_status
Date: Mon, 7 Mar 2022 15:47:43 +0530 [thread overview]
Message-ID: <20220307101743.8567-3-arun.ramadoss@microchip.com> (raw)
In-Reply-To: <20220307101743.8567-1-arun.ramadoss@microchip.com>
To read the master slave configuration of the LAN87xx T1 phy, used the
generic phy driver genphy_read_master_slave function. Removed the local
lan87xx_read_master_slave function.
Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
---
drivers/net/phy/microchip_t1.c | 30 +-----------------------------
1 file changed, 1 insertion(+), 29 deletions(-)
diff --git a/drivers/net/phy/microchip_t1.c b/drivers/net/phy/microchip_t1.c
index 8292f7305805..389df3f4293c 100644
--- a/drivers/net/phy/microchip_t1.c
+++ b/drivers/net/phy/microchip_t1.c
@@ -674,34 +674,6 @@ static int lan87xx_cable_test_get_status(struct phy_device *phydev,
return 0;
}
-static int lan87xx_read_master_slave(struct phy_device *phydev)
-{
- int rc = 0;
-
- phydev->master_slave_get = MASTER_SLAVE_CFG_UNKNOWN;
- phydev->master_slave_state = MASTER_SLAVE_STATE_UNKNOWN;
-
- rc = phy_read(phydev, MII_CTRL1000);
- if (rc < 0)
- return rc;
-
- if (rc & CTL1000_AS_MASTER)
- phydev->master_slave_get = MASTER_SLAVE_CFG_MASTER_FORCE;
- else
- phydev->master_slave_get = MASTER_SLAVE_CFG_SLAVE_FORCE;
-
- rc = phy_read(phydev, MII_STAT1000);
- if (rc < 0)
- return rc;
-
- if (rc & LPA_1000MSRES)
- phydev->master_slave_state = MASTER_SLAVE_STATE_MASTER;
- else
- phydev->master_slave_state = MASTER_SLAVE_STATE_SLAVE;
-
- return rc;
-}
-
static int lan87xx_read_status(struct phy_device *phydev)
{
int rc = 0;
@@ -720,7 +692,7 @@ static int lan87xx_read_status(struct phy_device *phydev)
phydev->pause = 0;
phydev->asym_pause = 0;
- rc = lan87xx_read_master_slave(phydev);
+ rc = genphy_read_master_slave(phydev);
if (rc < 0)
return rc;
--
2.33.0
next prev parent reply other threads:[~2022-03-07 10:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-07 10:17 [RFC PATCH net-next 0/2] net: phy: lan87xx: use genphy_read_master_slave function Arun Ramadoss
2022-03-07 10:17 ` [RFC PATCH net-next 1/2] net: phy: exported the " Arun Ramadoss
2022-03-07 13:53 ` Andrew Lunn
2022-03-07 10:17 ` Arun Ramadoss [this message]
2022-03-07 13:53 ` [RFC PATCH net-next 2/2] net: phy: lan87xx: use genphy_read_master_slave in read_status Andrew Lunn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220307101743.8567-3-arun.ramadoss@microchip.com \
--to=arun.ramadoss@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox