Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

static inline int of_get_phy_mode() is called with one too many argument #78

Open
romatou18 opened this issue Sep 23, 2021 · 1 comment

Comments

@romatou18
Copy link

Hi,
While patching an imx8 Zeus yocto Kernel v5.4.7, found that in fec_main.c in kernel/drivers/net/ethernet/freescale
The following function has 2 arguments being passed instead of one:
static inline int of_get_phy_mode()

fec_main.c call:

ret = of_get_phy_mode(pdev->dev.of_node, &interface);

Function definition in kernel 5.4.7:
https://elixir.bootlin.com/linux/v5.4.70/source/include/linux/of_net.h#L13

I just fixed this by removing the extra argument, however this just shows that the v5.4 ksz9897 patch or the imx 5.4 patch (identical in this repo), are probably out of sync with kernel source v5.4.x.

Kind Regards

Romain Firmware Engineer

@voodoo84
Copy link

In this specific case, older version of of_get_phy_mode() returned both error code (as negative value) or interface index (as positive value), while the new version returns strictly error code, and writes interface index into &interface address. So change it to:

interface = of_get_phy_mode(np); if (-ENODEV == interface) ... /* not found */

But obviously this patch is not based on mainline 5.4 so there are several occurrences of incompatibility which should be resolved manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants