linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: phy: dp83867: fix get nvmem cell fail
@ 2022-08-05  8:48 Nikita Shubin
  2022-08-05  9:57 ` Rasmus Villemoes
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nikita Shubin @ 2022-08-05  8:48 UTC (permalink / raw)
  Cc: linux, Nikita Shubin, Andrew Lunn, Heiner Kallweit, Russell King,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rasmus Villemoes, netdev, linux-kernel

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.

Fixes: 5c2d0a6a0701 ("net: phy: dp83867: implement support for io_impedance_ctrl nvmem cell")
Signed-off-by: Nikita Shubin <n.shubin@yadro.com>
---
 drivers/net/phy/dp83867.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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");
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: phy: dp83867: fix get nvmem cell fail
  2022-08-05  8:48 [PATCH] net: phy: dp83867: fix get nvmem cell fail Nikita Shubin
@ 2022-08-05  9:57 ` Rasmus Villemoes
  2022-08-05 19:57 ` Andrew Lunn
  2022-08-09  4:00 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Rasmus Villemoes @ 2022-08-05  9:57 UTC (permalink / raw)
  To: Nikita Shubin
  Cc: linux, Nikita Shubin, Andrew Lunn, Heiner Kallweit, Russell King,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	netdev, linux-kernel

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>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: phy: dp83867: fix get nvmem cell fail
  2022-08-05  8:48 [PATCH] net: phy: dp83867: fix get nvmem cell fail Nikita Shubin
  2022-08-05  9:57 ` Rasmus Villemoes
@ 2022-08-05 19:57 ` Andrew Lunn
  2022-08-09  4:00 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2022-08-05 19:57 UTC (permalink / raw)
  To: Nikita Shubin
  Cc: linux, Nikita Shubin, Heiner Kallweit, Russell King,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rasmus Villemoes, netdev, linux-kernel

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: phy: dp83867: fix get nvmem cell fail
  2022-08-05  8:48 [PATCH] net: phy: dp83867: fix get nvmem cell fail Nikita Shubin
  2022-08-05  9:57 ` Rasmus Villemoes
  2022-08-05 19:57 ` Andrew Lunn
@ 2022-08-09  4:00 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-08-09  4:00 UTC (permalink / raw)
  To: Nikita Shubin
  Cc: linux, n.shubin, andrew, hkallweit1, linux, davem, edumazet,
	kuba, pabeni, linux, netdev, linux-kernel

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-08-09  4:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-05  8:48 [PATCH] net: phy: dp83867: fix get nvmem cell fail Nikita Shubin
2022-08-05  9:57 ` Rasmus Villemoes
2022-08-05 19:57 ` Andrew Lunn
2022-08-09  4:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).