From: "Heiko Stübner" <heiko@sntech.de>
To: linux-rockchip@lists.infradead.org,
linux-phy@lists.infradead.org, Dragan Simic <dsimic@manjaro.org>
Cc: vkoul@kernel.org, kishon@kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] phy: phy-rockchip-inno-usb2: Handle failed extcon allocation better
Date: Thu, 15 Aug 2024 18:12:48 +0200 [thread overview]
Message-ID: <4927264.xgNZFEDtJV@diego> (raw)
In-Reply-To: <5fa7796d71e2f46344e972bc98a54539f55b6109.1723551599.git.dsimic@manjaro.org>
Am Dienstag, 13. August 2024, 20:38:17 CEST schrieb Dragan Simic:
> Return the actual error code upon failure to allocate extcon device, instead
> of hardcoding -ENOMEM. While there, produce an appropriate error message.
>
> Signed-off-by: Dragan Simic <dsimic@manjaro.org>
> ---
> drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> index 4f71373ae6e1..d33418a1e7a8 100644
> --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> @@ -434,8 +434,10 @@ static int rockchip_usb2phy_extcon_register(struct rockchip_usb2phy *rphy)
> edev = devm_extcon_dev_allocate(rphy->dev,
> rockchip_usb2phy_extcon_cable);
>
> - if (IS_ERR(edev))
> - return -ENOMEM;
> + if (IS_ERR(edev)) {
> + dev_err(rphy->dev, "failed to allocate extcon device\n");
> + return PTR_ERR(edev);
> + }
maybe even use dev_err_probe?
rockchip_usb2phy_extcon_register() gets called from the probe function,
so even using it is also sematically correct ;-) .
Heiko
>
> ret = devm_extcon_dev_register(rphy->dev, edev);
> if (ret) {
>
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
WARNING: multiple messages have this Message-ID (diff)
From: "Heiko Stübner" <heiko@sntech.de>
To: linux-rockchip@lists.infradead.org,
linux-phy@lists.infradead.org, Dragan Simic <dsimic@manjaro.org>
Cc: vkoul@kernel.org, kishon@kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] phy: phy-rockchip-inno-usb2: Handle failed extcon allocation better
Date: Thu, 15 Aug 2024 18:12:48 +0200 [thread overview]
Message-ID: <4927264.xgNZFEDtJV@diego> (raw)
In-Reply-To: <5fa7796d71e2f46344e972bc98a54539f55b6109.1723551599.git.dsimic@manjaro.org>
Am Dienstag, 13. August 2024, 20:38:17 CEST schrieb Dragan Simic:
> Return the actual error code upon failure to allocate extcon device, instead
> of hardcoding -ENOMEM. While there, produce an appropriate error message.
>
> Signed-off-by: Dragan Simic <dsimic@manjaro.org>
> ---
> drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> index 4f71373ae6e1..d33418a1e7a8 100644
> --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> @@ -434,8 +434,10 @@ static int rockchip_usb2phy_extcon_register(struct rockchip_usb2phy *rphy)
> edev = devm_extcon_dev_allocate(rphy->dev,
> rockchip_usb2phy_extcon_cable);
>
> - if (IS_ERR(edev))
> - return -ENOMEM;
> + if (IS_ERR(edev)) {
> + dev_err(rphy->dev, "failed to allocate extcon device\n");
> + return PTR_ERR(edev);
> + }
maybe even use dev_err_probe?
rockchip_usb2phy_extcon_register() gets called from the probe function,
so even using it is also sematically correct ;-) .
Heiko
>
> ret = devm_extcon_dev_register(rphy->dev, edev);
> if (ret) {
>
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
WARNING: multiple messages have this Message-ID (diff)
From: "Heiko Stübner" <heiko@sntech.de>
To: linux-rockchip@lists.infradead.org,
linux-phy@lists.infradead.org, Dragan Simic <dsimic@manjaro.org>
Cc: vkoul@kernel.org, kishon@kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] phy: phy-rockchip-inno-usb2: Handle failed extcon allocation better
Date: Thu, 15 Aug 2024 18:12:48 +0200 [thread overview]
Message-ID: <4927264.xgNZFEDtJV@diego> (raw)
In-Reply-To: <5fa7796d71e2f46344e972bc98a54539f55b6109.1723551599.git.dsimic@manjaro.org>
Am Dienstag, 13. August 2024, 20:38:17 CEST schrieb Dragan Simic:
> Return the actual error code upon failure to allocate extcon device, instead
> of hardcoding -ENOMEM. While there, produce an appropriate error message.
>
> Signed-off-by: Dragan Simic <dsimic@manjaro.org>
> ---
> drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> index 4f71373ae6e1..d33418a1e7a8 100644
> --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> @@ -434,8 +434,10 @@ static int rockchip_usb2phy_extcon_register(struct rockchip_usb2phy *rphy)
> edev = devm_extcon_dev_allocate(rphy->dev,
> rockchip_usb2phy_extcon_cable);
>
> - if (IS_ERR(edev))
> - return -ENOMEM;
> + if (IS_ERR(edev)) {
> + dev_err(rphy->dev, "failed to allocate extcon device\n");
> + return PTR_ERR(edev);
> + }
maybe even use dev_err_probe?
rockchip_usb2phy_extcon_register() gets called from the probe function,
so even using it is also sematically correct ;-) .
Heiko
>
> ret = devm_extcon_dev_register(rphy->dev, edev);
> if (ret) {
>
next prev parent reply other threads:[~2024-08-15 16:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-13 18:38 [PATCH] phy: phy-rockchip-inno-usb2: Handle failed extcon allocation better Dragan Simic
2024-08-13 18:38 ` Dragan Simic
2024-08-13 18:38 ` Dragan Simic
2024-08-15 16:12 ` Heiko Stübner [this message]
2024-08-15 16:12 ` Heiko Stübner
2024-08-15 16:12 ` Heiko Stübner
2024-08-17 6:52 ` Dragan Simic
2024-08-17 6:52 ` Dragan Simic
2024-08-17 6:52 ` Dragan Simic
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4927264.xgNZFEDtJV@diego \
--to=heiko@sntech.de \
--cc=dsimic@manjaro.org \
--cc=kishon@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.