* [PATCH] phy: ti: tusb1210: Fix an error handling path in tusb1210_probe()
@ 2022-04-03 13:06 ` Christophe JAILLET
0 siblings, 0 replies; 6+ messages in thread
From: Christophe JAILLET @ 2022-04-03 13:06 UTC (permalink / raw)
To: Kishon Vijay Abraham I, Vinod Koul, Hans de Goede, Stephan Gerhold
Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-phy
tusb1210_probe_charger_detect() must be undone by a corresponding
tusb1210_remove_charger_detect() in the error handling path, as already
done in the remove function.
Fixes: 48969a5623ed ("phy: ti: tusb1210: Add charger detection")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/phy/ti/phy-tusb1210.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/phy/ti/phy-tusb1210.c b/drivers/phy/ti/phy-tusb1210.c
index a0cdbcadf09e..008d80977fc5 100644
--- a/drivers/phy/ti/phy-tusb1210.c
+++ b/drivers/phy/ti/phy-tusb1210.c
@@ -537,12 +537,18 @@ static int tusb1210_probe(struct ulpi *ulpi)
tusb1210_probe_charger_detect(tusb);
tusb->phy = ulpi_phy_create(ulpi, &phy_ops);
- if (IS_ERR(tusb->phy))
- return PTR_ERR(tusb->phy);
+ if (IS_ERR(tusb->phy)) {
+ ret = PTR_ERR(tusb->phy);
+ goto err_remove_charger;
+ }
phy_set_drvdata(tusb->phy, tusb);
ulpi_set_drvdata(ulpi, tusb);
return 0;
+
+err_remove_charger:
+ tusb1210_remove_charger_detect(tusb);
+ return ret;
}
static void tusb1210_remove(struct ulpi *ulpi)
--
2.32.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] phy: ti: tusb1210: Fix an error handling path in tusb1210_probe()
@ 2022-04-03 13:06 ` Christophe JAILLET
0 siblings, 0 replies; 6+ messages in thread
From: Christophe JAILLET @ 2022-04-03 13:06 UTC (permalink / raw)
To: Kishon Vijay Abraham I, Vinod Koul, Hans de Goede, Stephan Gerhold
Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-phy
tusb1210_probe_charger_detect() must be undone by a corresponding
tusb1210_remove_charger_detect() in the error handling path, as already
done in the remove function.
Fixes: 48969a5623ed ("phy: ti: tusb1210: Add charger detection")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/phy/ti/phy-tusb1210.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/phy/ti/phy-tusb1210.c b/drivers/phy/ti/phy-tusb1210.c
index a0cdbcadf09e..008d80977fc5 100644
--- a/drivers/phy/ti/phy-tusb1210.c
+++ b/drivers/phy/ti/phy-tusb1210.c
@@ -537,12 +537,18 @@ static int tusb1210_probe(struct ulpi *ulpi)
tusb1210_probe_charger_detect(tusb);
tusb->phy = ulpi_phy_create(ulpi, &phy_ops);
- if (IS_ERR(tusb->phy))
- return PTR_ERR(tusb->phy);
+ if (IS_ERR(tusb->phy)) {
+ ret = PTR_ERR(tusb->phy);
+ goto err_remove_charger;
+ }
phy_set_drvdata(tusb->phy, tusb);
ulpi_set_drvdata(ulpi, tusb);
return 0;
+
+err_remove_charger:
+ tusb1210_remove_charger_detect(tusb);
+ return ret;
}
static void tusb1210_remove(struct ulpi *ulpi)
--
2.32.0
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] phy: ti: tusb1210: Fix an error handling path in tusb1210_probe()
2022-04-03 13:06 ` Christophe JAILLET
@ 2022-04-04 9:15 ` Hans de Goede
-1 siblings, 0 replies; 6+ messages in thread
From: Hans de Goede @ 2022-04-04 9:15 UTC (permalink / raw)
To: Christophe JAILLET, Kishon Vijay Abraham I, Vinod Koul, Stephan Gerhold
Cc: linux-kernel, kernel-janitors, linux-phy
Hi,
On 4/3/22 15:06, Christophe JAILLET wrote:
> tusb1210_probe_charger_detect() must be undone by a corresponding
> tusb1210_remove_charger_detect() in the error handling path, as already
> done in the remove function.
>
> Fixes: 48969a5623ed ("phy: ti: tusb1210: Add charger detection")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Thanks, patch looks good to me:
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Regards,
Hans
> ---
> drivers/phy/ti/phy-tusb1210.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/phy/ti/phy-tusb1210.c b/drivers/phy/ti/phy-tusb1210.c
> index a0cdbcadf09e..008d80977fc5 100644
> --- a/drivers/phy/ti/phy-tusb1210.c
> +++ b/drivers/phy/ti/phy-tusb1210.c
> @@ -537,12 +537,18 @@ static int tusb1210_probe(struct ulpi *ulpi)
> tusb1210_probe_charger_detect(tusb);
>
> tusb->phy = ulpi_phy_create(ulpi, &phy_ops);
> - if (IS_ERR(tusb->phy))
> - return PTR_ERR(tusb->phy);
> + if (IS_ERR(tusb->phy)) {
> + ret = PTR_ERR(tusb->phy);
> + goto err_remove_charger;
> + }
>
> phy_set_drvdata(tusb->phy, tusb);
> ulpi_set_drvdata(ulpi, tusb);
> return 0;
> +
> +err_remove_charger:
> + tusb1210_remove_charger_detect(tusb);
> + return ret;
> }
>
> static void tusb1210_remove(struct ulpi *ulpi)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] phy: ti: tusb1210: Fix an error handling path in tusb1210_probe()
@ 2022-04-04 9:15 ` Hans de Goede
0 siblings, 0 replies; 6+ messages in thread
From: Hans de Goede @ 2022-04-04 9:15 UTC (permalink / raw)
To: Christophe JAILLET, Kishon Vijay Abraham I, Vinod Koul, Stephan Gerhold
Cc: linux-kernel, kernel-janitors, linux-phy
Hi,
On 4/3/22 15:06, Christophe JAILLET wrote:
> tusb1210_probe_charger_detect() must be undone by a corresponding
> tusb1210_remove_charger_detect() in the error handling path, as already
> done in the remove function.
>
> Fixes: 48969a5623ed ("phy: ti: tusb1210: Add charger detection")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Thanks, patch looks good to me:
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Regards,
Hans
> ---
> drivers/phy/ti/phy-tusb1210.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/phy/ti/phy-tusb1210.c b/drivers/phy/ti/phy-tusb1210.c
> index a0cdbcadf09e..008d80977fc5 100644
> --- a/drivers/phy/ti/phy-tusb1210.c
> +++ b/drivers/phy/ti/phy-tusb1210.c
> @@ -537,12 +537,18 @@ static int tusb1210_probe(struct ulpi *ulpi)
> tusb1210_probe_charger_detect(tusb);
>
> tusb->phy = ulpi_phy_create(ulpi, &phy_ops);
> - if (IS_ERR(tusb->phy))
> - return PTR_ERR(tusb->phy);
> + if (IS_ERR(tusb->phy)) {
> + ret = PTR_ERR(tusb->phy);
> + goto err_remove_charger;
> + }
>
> phy_set_drvdata(tusb->phy, tusb);
> ulpi_set_drvdata(ulpi, tusb);
> return 0;
> +
> +err_remove_charger:
> + tusb1210_remove_charger_detect(tusb);
> + return ret;
> }
>
> static void tusb1210_remove(struct ulpi *ulpi)
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] phy: ti: tusb1210: Fix an error handling path in tusb1210_probe()
2022-04-03 13:06 ` Christophe JAILLET
@ 2022-04-11 17:37 ` Vinod Koul
-1 siblings, 0 replies; 6+ messages in thread
From: Vinod Koul @ 2022-04-11 17:37 UTC (permalink / raw)
To: Christophe JAILLET
Cc: Kishon Vijay Abraham I, Hans de Goede, Stephan Gerhold,
linux-kernel, kernel-janitors, linux-phy
On 03-04-22, 15:06, Christophe JAILLET wrote:
> tusb1210_probe_charger_detect() must be undone by a corresponding
> tusb1210_remove_charger_detect() in the error handling path, as already
> done in the remove function.
Applied, thanks
--
~Vinod
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] phy: ti: tusb1210: Fix an error handling path in tusb1210_probe()
@ 2022-04-11 17:37 ` Vinod Koul
0 siblings, 0 replies; 6+ messages in thread
From: Vinod Koul @ 2022-04-11 17:37 UTC (permalink / raw)
To: Christophe JAILLET
Cc: Kishon Vijay Abraham I, Hans de Goede, Stephan Gerhold,
linux-kernel, kernel-janitors, linux-phy
On 03-04-22, 15:06, Christophe JAILLET wrote:
> tusb1210_probe_charger_detect() must be undone by a corresponding
> tusb1210_remove_charger_detect() in the error handling path, as already
> done in the remove function.
Applied, thanks
--
~Vinod
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-04-11 17:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-03 13:06 [PATCH] phy: ti: tusb1210: Fix an error handling path in tusb1210_probe() Christophe JAILLET
2022-04-03 13:06 ` Christophe JAILLET
2022-04-04 9:15 ` Hans de Goede
2022-04-04 9:15 ` Hans de Goede
2022-04-11 17:37 ` Vinod Koul
2022-04-11 17:37 ` Vinod Koul
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.