Message ID | 20220805084843.24542-1-nikita.shubin@maquefel.me (mailing list archive) |
---|---|
State | Accepted |
Commit | 546b9d3f406a14cfbb12bfbf9fe1b302f1d860b5 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: phy: dp83867: fix get nvmem cell fail | expand |
On 05/08/2022 10.48, Nikita Shubin wrote: > From: Nikita Shubin <n.shubin@yadro.com> > > If CONFIG_NVMEM is not set of_nvmem_cell_get, of_nvmem_device_get > functions will return ERR_PTR(-EOPNOTSUPP) and "failed to get nvmem > cell io_impedance_ctrl" error would be reported despite "io_impedance_ctrl" > is completely missing in Device Tree and we should use default values. > > Check -EOPNOTSUPP togather with -ENOENT to avoid this situation. Ah, sorry about that, and thanks for catching. Acked-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
On Fri, Aug 05, 2022 at 11:48:43AM +0300, Nikita Shubin wrote: > From: Nikita Shubin <n.shubin@yadro.com> > > If CONFIG_NVMEM is not set of_nvmem_cell_get, of_nvmem_device_get > functions will return ERR_PTR(-EOPNOTSUPP) and "failed to get nvmem > cell io_impedance_ctrl" error would be reported despite "io_impedance_ctrl" > is completely missing in Device Tree and we should use default values. > > Check -EOPNOTSUPP togather with -ENOENT to avoid this situation. Should be 'together' Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew
Hello: This patch was applied to netdev/net.git (master) by Jakub Kicinski <kuba@kernel.org>: On Fri, 5 Aug 2022 11:48:43 +0300 you wrote: > From: Nikita Shubin <n.shubin@yadro.com> > > If CONFIG_NVMEM is not set of_nvmem_cell_get, of_nvmem_device_get > functions will return ERR_PTR(-EOPNOTSUPP) and "failed to get nvmem > cell io_impedance_ctrl" error would be reported despite "io_impedance_ctrl" > is completely missing in Device Tree and we should use default values. > > [...] Here is the summary with links: - net: phy: dp83867: fix get nvmem cell fail https://git.kernel.org/netdev/net/c/546b9d3f406a You are awesome, thank you!
diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c index 1e38039c5c56..6939563d3b7c 100644 --- a/drivers/net/phy/dp83867.c +++ b/drivers/net/phy/dp83867.c @@ -535,7 +535,7 @@ static int dp83867_of_init_io_impedance(struct phy_device *phydev) cell = of_nvmem_cell_get(of_node, "io_impedance_ctrl"); if (IS_ERR(cell)) { ret = PTR_ERR(cell); - if (ret != -ENOENT) + if (ret != -ENOENT && ret != -EOPNOTSUPP) return phydev_err_probe(phydev, ret, "failed to get nvmem cell io_impedance_ctrl\n");