Linux USB
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: linux-usb@vger.kernel.org, "Ajay Gupta" <ajayg@nvidia.com>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Dmitry Baryshkov" <dmitry.baryshkov@linaro.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Haotien Hsu" <haotienh@nvidia.com>,
	"Utkarsh Patel" <utkarsh.h.patel@intel.com>,
	"Uwe Kleine-König" <u.kleine-koenig@baylibre.com>,
	"Wolfram Sang" <wsa@the-dreams.de>,
	LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 2/2] usb: typec: ucsi: ccg: Use common code in ccg_read()
Date: Thu, 26 Sep 2024 17:54:22 +0300	[thread overview]
Message-ID: <ZvV1nqnbJMfTpgwI@kuha.fi.intel.com> (raw)
In-Reply-To: <a4087943-ee25-4e05-80c4-02a77196848b@web.de>

On Wed, Sep 25, 2024 at 07:33:47PM +0200, Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Wed, 25 Sep 2024 19:08:07 +0200
> 
> Add a label so that two statements can be better reused at the end of
> this function implementation.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

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

> ---
>  drivers/usb/typec/ucsi/ucsi_ccg.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
> index ed075a403d87..e3850c42583e 100644
> --- a/drivers/usb/typec/ucsi/ucsi_ccg.c
> +++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
> @@ -269,15 +269,16 @@ static int ccg_read(struct ucsi_ccg *uc, u16 rab, u8 *data, u32 len)
>  		status = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs));
>  		if (status < 0) {
>  			dev_err(uc->dev, "i2c_transfer failed %d\n", status);
> -			pm_runtime_put_sync(uc->dev);
> -			return status;
> +			goto put_sync;
>  		}
>  		rab += rlen;
>  		rem_len -= rlen;
>  	}
> 
> +	status = 0;
> +put_sync:
>  	pm_runtime_put_sync(uc->dev);
> -	return 0;
> +	return status;
>  }
> 
>  static int ccg_write(struct ucsi_ccg *uc, u16 rab, const u8 *data, u32 len)
> --
> 2.46.1

-- 
heikki

  reply	other threads:[~2024-09-26 14:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-25 17:31 [PATCH 0/2] usb: typec: ucsi: ccg: Adjustments for common code in two functions Markus Elfring
2024-09-25 17:32 ` [PATCH 1/2] usb: typec: ucsi: ccg: Use common code in ccg_write() Markus Elfring
2024-09-26 14:53   ` Heikki Krogerus
2024-09-25 17:33 ` [PATCH 2/2] usb: typec: ucsi: ccg: Use common code in ccg_read() Markus Elfring
2024-09-26 14:54   ` Heikki Krogerus [this message]
2024-09-25 21:26 ` [PATCH 0/2] usb: typec: ucsi: ccg: Adjustments for common code in two functions Dmitry Baryshkov
2024-09-26 12:12   ` Andy Shevchenko
2024-09-26 12:20     ` Dmitry Baryshkov
2024-09-26 12:27       ` Andy Shevchenko
2024-09-26 12:31         ` Dmitry Baryshkov

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=ZvV1nqnbJMfTpgwI@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=Markus.Elfring@web.de \
    --cc=ajayg@nvidia.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=haotienh@nvidia.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=u.kleine-koenig@baylibre.com \
    --cc=utkarsh.h.patel@intel.com \
    --cc=wsa@the-dreams.de \
    /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