Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Cc: Isabella Caselli <bellacaselli20@gmail.com>,
	jean-baptiste.maneyrol@tdk.com, lars@metafoo.de,
	linux-iio@vger.kernel.org, rodrigo.michelassi@usp.br
Subject: Re: [PATCH v3] iio: imu: inv_mpu6050: refactor aux read/write to use shared xfer logic
Date: Sun, 25 May 2025 18:23:45 +0100	[thread overview]
Message-ID: <20250525182345.351ec4cf@jic23-huawei> (raw)
In-Reply-To: <20250515174711.78457e4b@jic23-huawei>

On Thu, 15 May 2025 17:47:11 +0100
Jonathan Cameron <jic23@kernel.org> wrote:

> On Sat, 10 May 2025 15:39:33 -0300
> Marcelo Schmitt <marcelo.schmitt1@gmail.com> wrote:
> 
> > Hi Isabella, Rodrigo,
> > 
> > This patch looks okay to me. Though, I think Jean-Baptiste made a valid point in
> > v1 about inv_mpu_i2c_master_xfer() not implying any specific slave slot
> > previously. I'd suggest to add a slv parameter to inv_mpu_i2c_master_xfer(), but
> > that wouldn't make much difference since inv_mpu_aux_read/write() are still
> > hardcoded for SLV 0.
> > Besides that, I have one minor comment that's probably not a reason for a v4 if
> > this is deemed to be good.  
> 
> I'm looking for a tag from Jean-Baptiste on this.

Jean-Baptiste. If you have time to look at this version that would be great.

> 
> Jonathan
> 
> > 
> > Regards,
> > Marcelo
> > 
> > On 05/07, Isabella Caselli wrote:  
> > > Refactors inv_mpu_aux_read() and inv_mpu_aux_write() to extract the common
> > > I2C transfer sequence into inv_mpu_i2c_master_xfer(), which now handles
> > > starting and stopping the I2C master, waiting for completion, disabling
> > > SLV0, and checking for NACK errors.
> > > 
> > > This refactoring removes code duplication and improves maintainability.
> > > No functional changes are intended.
> > > 
> > > Signed-off-by: Isabella Caselli <bellacaselli20@gmail.com>
> > > Co-developed-by: Rodrigo Michelassi <rodrigo.michelassi@usp.br>
> > > Signed-off-by: Rodrigo Michelassi <rodrigo.michelassi@usp.br>
> > > ---    
> > ...  
> > >  static int inv_mpu_i2c_master_xfer(const struct inv_mpu6050_state *st)
> > >  {
> > > @@ -23,6 +25,7 @@ static int inv_mpu_i2c_master_xfer(const struct inv_mpu6050_state *st)
> > >  	uint8_t d;
> > >  	unsigned int user_ctrl;
> > >  	int ret;
> > > +	unsigned int status;    
> > I'd declare status above ret, or together with user_ctrl.
> > Just minor code style thing.  
> 
> 


  reply	other threads:[~2025-05-25 17:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-07 18:39 [PATCH v3] iio: imu: inv_mpu6050: refactor aux read/write to use shared xfer logic Isabella Caselli
2025-05-10 18:39 ` Marcelo Schmitt
2025-05-15 16:47   ` Jonathan Cameron
2025-05-25 17:23     ` Jonathan Cameron [this message]
2025-05-27  9:53       ` Jean-Baptiste Maneyrol
2025-05-31 15:08         ` Jonathan Cameron

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=20250525182345.351ec4cf@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=bellacaselli20@gmail.com \
    --cc=jean-baptiste.maneyrol@tdk.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=marcelo.schmitt1@gmail.com \
    --cc=rodrigo.michelassi@usp.br \
    /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