public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Vinod Koul <vkoul@kernel.org>,
	Stephan Gerhold <stephan@gerhold.net>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-phy@lists.infradead.org
Subject: Re: [PATCH] phy: ti: tusb1210: Fix an error handling path in tusb1210_probe()
Date: Mon, 4 Apr 2022 11:15:28 +0200	[thread overview]
Message-ID: <dbd72dd0-5898-dfd7-00a0-475fb798c595@redhat.com> (raw)
In-Reply-To: <07c4926c42243cedb3b6067a241bb486fdda01b5.1648991162.git.christophe.jaillet@wanadoo.fr>

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)


  reply	other threads:[~2022-04-04  9:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-03 13:06 [PATCH] phy: ti: tusb1210: Fix an error handling path in tusb1210_probe() Christophe JAILLET
2022-04-04  9:15 ` Hans de Goede [this message]
2022-04-11 17:37 ` Vinod Koul

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=dbd72dd0-5898-dfd7-00a0-475fb798c595@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=stephan@gerhold.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox