lkml.org 
[lkml]   [2022]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v5 5/7] net: phy: adin1100: Add initial support for ADIN1100 industrial PHY
From
Hi,

>> +static int adin_config_aneg(struct phy_device *phydev)
>> +{
>> + struct adin_priv *priv = phydev->priv;
>> + int ret;
>> +
>> + if (phydev->autoneg == AUTONEG_DISABLE) {
>> + ret = genphy_c45_pma_setup_forced(phydev);
>> + if (ret < 0)
>> + return ret;
>> +
>> + if (priv->tx_level_prop_present && priv->tx_level_2v4) {
>> + ret = phy_set_bits_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_B10L_PMA_CTRL,
>> + MDIO_PMA_10T1L_CTRL_2V4_EN);
>> + if (ret < 0)
>> + return ret;
>> + } else {
>> + ret = phy_clear_bits_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_B10L_PMA_CTRL,
>> + MDIO_PMA_10T1L_CTRL_2V4_EN);
>> + if (ret < 0)
>> + return ret;
>> + }
move below out if/else

if(ret < 0)
return ret;


>> +static int adin_set_powerdown_mode(struct phy_device *phydev, bool en)
>> +{
>> + int ret;
>> + int val;
>> +
>> + if (en)
>> + val = ADIN_CRSM_SFT_PD_CNTRL_EN;
>> + else
>> + val = 0;please consider below change which looks neat
val = en? ADIN_CRSM_SFT_PD_CNTRL_EN : 0


Best regards,
Furong

\
 
 \ /
  Last update: 2022-04-12 02:19    [W:2.062 / U:1.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site