mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] usb: common: usb-conn-gpio: Simplify some error message
@ 2022-08-06  5:19 Christophe JAILLET
  2022-08-08  8:35 ` Chunfeng Yun
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2022-08-06  5:19 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Chunfeng Yun
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-usb

dev_err_probe() already prints the error code in a human readable way, so
there is no need to duplicate it as a numerical value at the end of the
message.

Fixes: ddaf0d6dc467 ("usb: common: usb-conn-gpio: use dev_err_probe() to print log")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/usb/common/usb-conn-gpio.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/common/usb-conn-gpio.c b/drivers/usb/common/usb-conn-gpio.c
index b39c9f1c375d..44c5127175b7 100644
--- a/drivers/usb/common/usb-conn-gpio.c
+++ b/drivers/usb/common/usb-conn-gpio.c
@@ -208,10 +208,9 @@ static int usb_conn_probe(struct platform_device *pdev)
 	if (PTR_ERR(info->vbus) == -ENODEV)
 		info->vbus = NULL;
 
-	if (IS_ERR(info->vbus)) {
-		ret = PTR_ERR(info->vbus);
-		return dev_err_probe(dev, ret, "failed to get vbus :%d\n", ret);
-	}
+	if (IS_ERR(info->vbus))
+		return dev_err_probe(dev, PTR_ERR(info->vbus),
+				     "failed to get vbus\n");
 
 	info->role_sw = usb_role_switch_get(dev);
 	if (IS_ERR(info->role_sw))
-- 
2.34.1


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

* Re: [PATCH] usb: common: usb-conn-gpio: Simplify some error message
  2022-08-06  5:19 [PATCH] usb: common: usb-conn-gpio: Simplify some error message Christophe JAILLET
@ 2022-08-08  8:35 ` Chunfeng Yun
  0 siblings, 0 replies; 2+ messages in thread
From: Chunfeng Yun @ 2022-08-08  8:35 UTC (permalink / raw)
  To: Christophe JAILLET, Greg Kroah-Hartman
  Cc: linux-kernel, kernel-janitors, linux-usb

On Sat, 2022-08-06 at 07:19 +0200, Christophe JAILLET wrote:
> dev_err_probe() already prints the error code in a human readable
> way, so
> there is no need to duplicate it as a numerical value at the end of
> the
> message.
> 
> Fixes: ddaf0d6dc467 ("usb: common: usb-conn-gpio: use dev_err_probe()
> to print log")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  drivers/usb/common/usb-conn-gpio.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/common/usb-conn-gpio.c
> b/drivers/usb/common/usb-conn-gpio.c
> index b39c9f1c375d..44c5127175b7 100644
> --- a/drivers/usb/common/usb-conn-gpio.c
> +++ b/drivers/usb/common/usb-conn-gpio.c
> @@ -208,10 +208,9 @@ static int usb_conn_probe(struct platform_device
> *pdev)
>  	if (PTR_ERR(info->vbus) == -ENODEV)
>  		info->vbus = NULL;
>  
> -	if (IS_ERR(info->vbus)) {
> -		ret = PTR_ERR(info->vbus);
> -		return dev_err_probe(dev, ret, "failed to get vbus
> :%d\n", ret);
> -	}
> +	if (IS_ERR(info->vbus))
> +		return dev_err_probe(dev, PTR_ERR(info->vbus),
> +				     "failed to get vbus\n");
How about putting dev_err_probe() in a single line? it doesn't exceed
100 chars.

>  
>  	info->role_sw = usb_role_switch_get(dev);
>  	if (IS_ERR(info->role_sw))


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

end of thread, other threads:[~2022-08-08  8:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-06  5:19 [PATCH] usb: common: usb-conn-gpio: Simplify some error message Christophe JAILLET
2022-08-08  8:35 ` Chunfeng Yun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®