linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: typec: mux: Remove the use of dev_err_probe()
@ 2025-08-19 11:24 Xichao Zhao
  2025-08-19 14:46 ` Romain Gantois
  2025-08-21  7:23 ` Heikki Krogerus
  0 siblings, 2 replies; 3+ messages in thread
From: Xichao Zhao @ 2025-08-19 11:24 UTC (permalink / raw)
  To: romain.gantois, heikki.krogerus, gregkh
  Cc: linux-usb, linux-kernel, Xichao Zhao

The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
Therefore, remove the useless call to dev_err_probe(), and just
return the value instead.

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
 drivers/usb/typec/mux/tusb1046.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/typec/mux/tusb1046.c b/drivers/usb/typec/mux/tusb1046.c
index b4f45c217b59..3c1a4551c2fb 100644
--- a/drivers/usb/typec/mux/tusb1046.c
+++ b/drivers/usb/typec/mux/tusb1046.c
@@ -129,7 +129,7 @@ static int tusb1046_i2c_probe(struct i2c_client *client)
 
 	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
 	if (!priv)
-		return dev_err_probe(dev, -ENOMEM, "failed to allocate driver data\n");
+		return -ENOMEM;
 
 	priv->client = client;
 
-- 
2.34.1


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

* Re: [PATCH] usb: typec: mux: Remove the use of dev_err_probe()
  2025-08-19 11:24 [PATCH] usb: typec: mux: Remove the use of dev_err_probe() Xichao Zhao
@ 2025-08-19 14:46 ` Romain Gantois
  2025-08-21  7:23 ` Heikki Krogerus
  1 sibling, 0 replies; 3+ messages in thread
From: Romain Gantois @ 2025-08-19 14:46 UTC (permalink / raw)
  To: heikki.krogerus, gregkh, Xichao Zhao; +Cc: linux-usb, linux-kernel, Xichao Zhao

[-- Attachment #1: Type: text/plain, Size: 927 bytes --]

On Tuesday, 19 August 2025 13:24:51 CEST Xichao Zhao wrote:
> The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
> Therefore, remove the useless call to dev_err_probe(), and just
> return the value instead.
> 
> Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
> ---
>  drivers/usb/typec/mux/tusb1046.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/typec/mux/tusb1046.c
> b/drivers/usb/typec/mux/tusb1046.c index b4f45c217b59..3c1a4551c2fb 100644
> --- a/drivers/usb/typec/mux/tusb1046.c
> +++ b/drivers/usb/typec/mux/tusb1046.c
> @@ -129,7 +129,7 @@ static int tusb1046_i2c_probe(struct i2c_client *client)
> 
>  	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
>  	if (!priv)
> -		return dev_err_probe(dev, -ENOMEM, "failed to allocate driver 
data\n");
> +		return -ENOMEM;
> 
>  	priv->client = client;

Reviewed-by: Romain Gantois <romain.gantois@bootlin.com>



[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] usb: typec: mux: Remove the use of dev_err_probe()
  2025-08-19 11:24 [PATCH] usb: typec: mux: Remove the use of dev_err_probe() Xichao Zhao
  2025-08-19 14:46 ` Romain Gantois
@ 2025-08-21  7:23 ` Heikki Krogerus
  1 sibling, 0 replies; 3+ messages in thread
From: Heikki Krogerus @ 2025-08-21  7:23 UTC (permalink / raw)
  To: Xichao Zhao; +Cc: romain.gantois, gregkh, linux-usb, linux-kernel

On Tue, Aug 19, 2025 at 07:24:51PM +0800, Xichao Zhao wrote:
> The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
> Therefore, remove the useless call to dev_err_probe(), and just
> return the value instead.
> 
> Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/usb/typec/mux/tusb1046.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/typec/mux/tusb1046.c b/drivers/usb/typec/mux/tusb1046.c
> index b4f45c217b59..3c1a4551c2fb 100644
> --- a/drivers/usb/typec/mux/tusb1046.c
> +++ b/drivers/usb/typec/mux/tusb1046.c
> @@ -129,7 +129,7 @@ static int tusb1046_i2c_probe(struct i2c_client *client)
>  
>  	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
>  	if (!priv)
> -		return dev_err_probe(dev, -ENOMEM, "failed to allocate driver data\n");
> +		return -ENOMEM;
>  
>  	priv->client = client;
>  
> -- 
> 2.34.1

-- 
heikki

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

end of thread, other threads:[~2025-08-21  7:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-19 11:24 [PATCH] usb: typec: mux: Remove the use of dev_err_probe() Xichao Zhao
2025-08-19 14:46 ` Romain Gantois
2025-08-21  7:23 ` Heikki Krogerus

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).