Skip to contentSkip to conversation

platform/chrome: cros_ec_typec: Use dev_err_probe on port register fail

PATCH Applied Nícolas F. R. A. Prado 4 participants 5 messages Jul 12, 2022 – Jul 15, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/chrome: cros_ec_typec: Use dev_err_probe on port register fail

The typec_register_port() can fail with EPROBE_DEFER if the endpoint node hasn't probed yet. In order to avoid spamming the log with errors in that case, log using dev_err_probe().

---

 drivers/platform/chrome/cros_ec_typec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/chrome/cros_ec_typec.c +1 -1
index d6088ba447af..8c0ca3c128ee 100644
@@ -352,8 +352,8 @@ static int cros_typec_init_ports(struct cros_typec_data *typec)
 
 		cros_port->port = typec_register_port(dev, cap);
 		if (IS_ERR(cros_port->port)) {
-			dev_err(dev, "Failed to register port %d\n", port_num);
 			ret = PTR_ERR(cros_port->port);
+			dev_err_probe(dev, ret, "Failed to register port %d\n", port_num);
 			goto unregister_ports;
 		}
 
Signature · 1 line
2.37.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Nícolas F. R. A. Prado

The typec_register_port() can fail with EPROBE_DEFER if the endpoint node hasn't probed yet. In order to avoid spamming the log with errors in that case, log using dev_err_probe().

Quoted 23 lines

---

 drivers/platform/chrome/cros_ec_typec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/chrome/cros_ec_typec.c +1 -2
index d6088ba447af..8c0ca3c128ee 100644
@@ -352,8 +352,8 @@ static int cros_typec_init_ports(struct cros_typec_data *typec)
 
                cros_port->port = typec_register_port(dev, cap);
                if (IS_ERR(cros_port->port)) {
-                       dev_err(dev, "Failed to register port %d\n", port_num);
                        ret = PTR_ERR(cros_port->port);
+                       dev_err_probe(dev, ret, "Failed to register port %d\n", port_num);
                        goto unregister_ports;
                }
 
--

2.37.0

#3 lore raw
In reply to Nícolas F. R. A. Prado
This patch was applied to chrome-platform/linux.git (for-kernelci) by Prashant Malani <[email protected]>:

Hello:

This patch was applied to chrome-platform/linux.git (for-kernelci) by Prashant Malani <[email protected]>:

Quoted 8 lines · On Tue, 12 Jul 2022 17:45:54 -0400 you wrote:

The typec_register_port() can fail with EPROBE_DEFER if the endpoint node hasn't probed yet. In order to avoid spamming the log with errors in that case, log using dev_err_probe().

[...]

Here is the summary with links:
- platform/chrome: cros_ec_typec: Use dev_err_probe on port register fail

    https://git.kernel.org/chrome-platform/c/ce838f7dc795

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
#4 lore raw
In reply to Nícolas F. R. A. Prado
This patch was applied to chrome-platform/linux.git (for-next) by Prashant Malani <[email protected]>:

Hello:

This patch was applied to chrome-platform/linux.git (for-next) by Prashant Malani <[email protected]>:

Quoted 8 lines · On Tue, 12 Jul 2022 17:45:54 -0400 you wrote:

The typec_register_port() can fail with EPROBE_DEFER if the endpoint node hasn't probed yet. In order to avoid spamming the log with errors in that case, log using dev_err_probe().

[...]

Here is the summary with links:
- platform/chrome: cros_ec_typec: Use dev_err_probe on port register fail

    https://git.kernel.org/chrome-platform/c/ce838f7dc795

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html