From: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
To: Isabella Caselli <bellacaselli20@gmail.com>
Cc: jean-baptiste.maneyrol@tdk.com, jic23@kernel.org,
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: Sat, 10 May 2025 15:39:33 -0300 [thread overview]
Message-ID: <aB-dZecEekMsAEWj@debian-BULLSEYE-live-builder-AMD64> (raw)
In-Reply-To: <20250507184539.54658-1-bellacaselli20@gmail.com>
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.
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.
next prev parent reply other threads:[~2025-05-10 18:38 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 [this message]
2025-05-15 16:47 ` Jonathan Cameron
2025-05-25 17:23 ` Jonathan Cameron
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=aB-dZecEekMsAEWj@debian-BULLSEYE-live-builder-AMD64 \
--to=marcelo.schmitt1@gmail.com \
--cc=bellacaselli20@gmail.com \
--cc=jean-baptiste.maneyrol@tdk.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--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