mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Su Hui <suhui@nfschina.com>
To: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
Cc: jic23@kernel.org, lars@metafoo.de,
	jean-baptiste.maneyrol@tdk.com, chenhuiz@axis.com,
	andy.shevchenko@gmail.com, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 2/2] phy: mapphone-mdm6600: fix an error code problem in inv_mpu6050_read_raw
Date: Mon, 23 Oct 2023 11:29:30 +0800	[thread overview]
Message-ID: <bccca54f-5eb8-83ba-17ad-6cb312aa6ea5@nfschina.com> (raw)
In-Reply-To: <7f81d365-0440-de01-8be4-9c8d3ab9d69c@nfschina.com>

On 2023/10/23 09:33, Su Hui wrote:
> On 2023/10/20 23:55, Jonathan Cameron wrote:
>> I'm not sure why inv_mpu6050_sensor_show() doesn't return
>> the actual error code from the regmap_bulk_read() and instead 
>> replaces it
>> with -EINVAL.  Given you are tidying up this related issues perhaps 
>> change
>> that as well?
>>
>> static int inv_mpu6050_sensor_show(struct inv_mpu6050_state *st, int 
>> reg,
>>                    int axis, int *val)
>> {
>>     int ind, result;
>>     __be16 d;
>>
>>     ind = (axis - IIO_MOD_X) * 2;
>>     result = regmap_bulk_read(st->map, reg + ind, &d, sizeof(d));
>>     if (result)
>>         return -EINVAL;
>> //Make this return result;
>
> Sure, I will tidy up this, Thanks for your suggestion!

I'm not sure  whether the caller could handler this  when return 
'result' rather than '-EINVAL'.

This is not a big problem, maybe we shouldn't modify this code.

Su Hui


  reply	other threads:[~2023-10-23  3:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-20  9:14 [PATCH 1/2] phy: mapphone-mdm6600: fix an error code problem in phy_mdm6600_device_power_on Su Hui
2023-10-20  9:14 ` [PATCH 2/2] phy: mapphone-mdm6600: fix an error code problem in inv_mpu6050_read_raw Su Hui
2023-10-20 15:55   ` Jonathan Cameron
2023-10-23  1:33     ` Su Hui
2023-10-23  3:29       ` Su Hui [this message]
2023-11-16 11:26 ` [PATCH 1/2] phy: mapphone-mdm6600: fix an error code problem in phy_mdm6600_device_power_on Vinod Koul
2023-11-17  1:22   ` Su Hui

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=bccca54f-5eb8-83ba-17ad-6cb312aa6ea5@nfschina.com \
    --to=suhui@nfschina.com \
    --cc=Jonathan.Cameron@Huawei.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=chenhuiz@axis.com \
    --cc=jean-baptiste.maneyrol@tdk.com \
    --cc=jic23@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.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

all inboxes | Powered by JetHome®