Skip to content

Commit dae8931

Browse files
committed
Merge branch 'net-phy-dp83822-add-optional-external-phy-clock'
Stefan Wahren says: ==================== net: phy: dp83822: Add optional external PHY clock This small series implement support for external PHY clock for the dp83822 driver. ==================== Link: https://patch.msgid.link/20260528184642.33424-1-wahrenst@gmx.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents ceac8db + 8a9f9bd commit dae8931

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

drivers/net/phy/dp83822.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Copyright (C) 2017 Texas Instruments Inc.
55
*/
66

7+
#include <linux/clk.h>
78
#include <linux/ethtool.h>
89
#include <linux/etherdevice.h>
910
#include <linux/kernel.h>
@@ -984,13 +985,20 @@ static int dp83822_attach_mdi_port(struct phy_device *phydev,
984985

985986
static int dp8382x_probe(struct phy_device *phydev)
986987
{
988+
struct device *dev = &phydev->mdio.dev;
987989
struct dp83822_private *dp83822;
990+
struct clk *clk;
988991

989-
dp83822 = devm_kzalloc(&phydev->mdio.dev, sizeof(*dp83822),
990-
GFP_KERNEL);
992+
dp83822 = devm_kzalloc(dev, sizeof(*dp83822), GFP_KERNEL);
991993
if (!dp83822)
992994
return -ENOMEM;
993995

996+
clk = devm_clk_get_optional_enabled(dev, NULL);
997+
if (IS_ERR(clk)) {
998+
return dev_err_probe(dev, PTR_ERR(clk),
999+
"Failed to request ref clock\n");
1000+
}
1001+
9941002
dp83822->tx_amplitude_100base_tx_index = -1;
9951003
dp83822->mac_termination_index = -1;
9961004
phydev->priv = dp83822;

0 commit comments

Comments
 (0)