]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: phy: dp83822: fix transmit amplitude if CONFIG_OF_MDIO not defined
authorDimitri Fedrau <dimitri.fedrau@liebherr.com>
Mon, 17 Mar 2025 07:48:34 +0000 (08:48 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 06:02:15 +0000 (08:02 +0200)
commit 8fa649fd7d3009769c7289d0c31c319b72bc42c4 upstream.

When CONFIG_OF_MDIO is not defined the index for selecting the transmit
amplitude voltage for 100BASE-TX is set to 0, but it should be -1, if there
is no need to modify the transmit amplitude voltage. Move initialization of
the index from dp83822_of_init to dp8382x_probe.

Fixes: 4f3735e82d8a ("net: phy: dp83822: Add support for changing the transmit amplitude voltage")
Reviewed-by: Gerhard Engleder <gerhard@engleder-embedded.com>
Signed-off-by: Dimitri Fedrau <dimitri.fedrau@liebherr.com>
Link: https://patch.msgid.link/20250317-dp83822-fix-transceiver-mdio-v2-1-fb09454099a4@liebherr.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/phy/dp83822.c

index 89094aa6dbbdbaeb345110de4ee88a013c26e8c5..e32013eb0186ff8658cf7bf566aa2055c698d4ec 100644 (file)
@@ -833,7 +833,6 @@ static int dp83822_of_init(struct phy_device *phydev)
                dp83822->set_gpio2_clk_out = true;
        }
 
-       dp83822->tx_amplitude_100base_tx_index = -1;
        ret = phy_get_tx_amplitude_gain(phydev, dev,
                                        ETHTOOL_LINK_MODE_100baseT_Full_BIT,
                                        &val);
@@ -931,6 +930,7 @@ static int dp8382x_probe(struct phy_device *phydev)
        if (!dp83822)
                return -ENOMEM;
 
+       dp83822->tx_amplitude_100base_tx_index = -1;
        phydev->priv = dp83822;
 
        return 0;