Skip to content

Commit 93c3a96

Browse files
kmaincentkuba-moo
authored andcommitted
net: pse-pd: Do not return EOPNOSUPP if config is null
For a PSE supporting both c33 and PoDL, setting config for one type of PoE leaves the other type's config null. Currently, this case returns EOPNOTSUPP, which is incorrect. Instead, we should do nothing if the configuration is empty. Signed-off-by: Kory Maincent <[email protected]> Fixes: d83e137 ("net: pse-pd: Use regulator framework within PSE framework") Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 70c676c commit 93c3a96

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

drivers/net/pse-pd/pse_core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,13 +719,13 @@ int pse_ethtool_set_config(struct pse_control *psec,
719719
{
720720
int err = 0;
721721

722-
if (pse_has_c33(psec)) {
722+
if (pse_has_c33(psec) && config->c33_admin_control) {
723723
err = pse_ethtool_c33_set_config(psec, config);
724724
if (err)
725725
return err;
726726
}
727727

728-
if (pse_has_podl(psec))
728+
if (pse_has_podl(psec) && config->podl_admin_control)
729729
err = pse_ethtool_podl_set_config(psec, config);
730730

731731
return err;

net/ethtool/pse-pd.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,9 @@ ethnl_set_pse(struct ethnl_req_info *req_info, struct genl_info *info)
183183
if (pse_has_c33(phydev->psec))
184184
config.c33_admin_control = nla_get_u32(tb[ETHTOOL_A_C33_PSE_ADMIN_CONTROL]);
185185

186-
/* Return errno directly - PSE has no notification */
186+
/* Return errno directly - PSE has no notification
187+
* pse_ethtool_set_config() will do nothing if the config is null
188+
*/
187189
return pse_ethtool_set_config(phydev->psec, info->extack, &config);
188190
}
189191

0 commit comments

Comments
 (0)