Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1633852

Re: [PATCH v2 2/4] iio: accel: adxl345_core: Introduce set_mode and data_ready functions

From Jonathan Cameron <jic23@jic23.retrosnub.co.uk>
Newsgroups linux.kernel
Subject Re: [PATCH v2 2/4] iio: accel: adxl345_core: Introduce set_mode and data_ready functions
Date 2017-05-01 22:20 +0200
Message-ID <tCpXz-5cq-9@gated-at.bofh.it> (permalink)
References (1 earlier) <tBvsm-3tN-3@gated-at.bofh.it> <tC7nX-1Ja-3@gated-at.bofh.it> <tCpux-4NU-7@gated-at.bofh.it> <tCpux-4NU-15@gated-at.bofh.it> <tCpNT-59h-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 1 May 2017 21:07:44 BST, Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
>On Mon, May 1, 2017 at 10:48 PM, Jonathan Cameron
><jic23@jic23.retrosnub.co.uk> wrote:
>> On 1 May 2017 20:42:08 BST, Andy Shevchenko
><andy.shevchenko@gmail.com> wrote:
>>>On Mon, May 1, 2017 at 3:22 AM, Jonathan Cameron <jic23@kernel.org>
>>>wrote:
>>>> On 29/04/17 08:48, Eva Rachel Retuya wrote:
>>>
>>>>> +static int adxl345_set_mode(struct adxl345_data *data, u8 mode)
>>>>> +{
>>>>> +     struct device *dev = regmap_get_device(data->regmap);
>>>>> +     int ret;
>>>>> +
>>>>> +     ret = regmap_write(data->regmap, ADXL345_REG_POWER_CTL,
>mode);
>>>>> +     if (ret < 0) {
>>>>> +             dev_err(dev, "Failed to set power mode, %d\n", ret);
>>>>> +             return ret;
>>>> drop the return ret here and just return ret at the end of the
>>>function.
>>>> One of the static checkers will probably moan about this otherwise.
>>>
>>>But this will be not equivalent!
>> Why? Regmap_write returns 0 for success.
>
>If there is a qurantee that regmap_write() doesn't return any positive
>values, I'm okay with replacement.
Kernel doc says so.

>http://lxr.free-electrons.com/source/drivers/base/regmap/regmap.c#L1693
>>>
>>>>> +     }
>>>>> +
>>>>> +     return 0;
>>>>> +}

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/4] iio: accel: adxl345: Add support for buffered readings Eva Rachel Retuya <eraretuya@gmail.com> - 2017-04-29 09:50 +0200
  [PATCH v2 2/4] iio: accel: adxl345_core: Introduce set_mode and data_ready functions Eva Rachel Retuya <eraretuya@gmail.com> - 2017-04-29 10:00 +0200
    Re: [PATCH v2 2/4] iio: accel: adxl345_core: Introduce set_mode and  data_ready functions Jonathan Cameron <jic23@kernel.org> - 2017-05-01 02:30 +0200
      Re: [PATCH v2 2/4] iio: accel: adxl345_core: Introduce set_mode and  data_ready functions Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-05-01 21:50 +0200
        Re: [PATCH v2 2/4] iio: accel: adxl345_core: Introduce set_mode and data_ready functions Jonathan Cameron <jic23@jic23.retrosnub.co.uk> - 2017-05-01 21:50 +0200
          Re: [PATCH v2 2/4] iio: accel: adxl345_core: Introduce set_mode and  data_ready functions Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-05-01 22:10 +0200
            Re: [PATCH v2 2/4] iio: accel: adxl345_core: Introduce set_mode and data_ready functions Jonathan Cameron <jic23@jic23.retrosnub.co.uk> - 2017-05-01 22:20 +0200
      Re: [PATCH v2 2/4] iio: accel: adxl345_core: Introduce set_mode and  data_ready functions Eva Rachel Retuya <eraretuya@gmail.com> - 2017-05-02 13:40 +0200
        Re: [PATCH v2 2/4] iio: accel: adxl345_core: Introduce set_mode and  data_ready functions Jonathan Cameron <jic23@kernel.org> - 2017-05-02 18:40 +0200
          Re: [PATCH v2 2/4] iio: accel: adxl345_core: Introduce set_mode and  data_ready functions Eva Rachel Retuya <eraretuya@gmail.com> - 2017-05-10 15:10 +0200
    Re: [PATCH v2 2/4] iio: accel: adxl345_core: Introduce set_mode and  data_ready functions Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-05-01 13:30 +0200
      Re: [PATCH v2 2/4] iio: accel: adxl345_core: Introduce set_mode and  data_ready functions Eva Rachel Retuya <eraretuya@gmail.com> - 2017-05-02 13:50 +0200
  [PATCH v2 4/4] iio: accel: adxl345: Add support for triggered buffer Eva Rachel Retuya <eraretuya@gmail.com> - 2017-04-29 10:00 +0200
    Re: [PATCH v2 4/4] iio: accel: adxl345: Add support for triggered  buffer Jonathan Cameron <jic23@kernel.org> - 2017-05-01 02:50 +0200
      Re: [PATCH v2 4/4] iio: accel: adxl345: Add support for triggered  buffer Eva Rachel Retuya <eraretuya@gmail.com> - 2017-05-02 14:30 +0200
        Re: [PATCH v2 4/4] iio: accel: adxl345: Add support for triggered  buffer Jonathan Cameron <jic23@kernel.org> - 2017-05-02 18:10 +0200
    Re: [PATCH v2 4/4] iio: accel: adxl345: Add support for triggered buffer Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-05-01 13:30 +0200
      Re: [PATCH v2 4/4] iio: accel: adxl345: Add support for triggered  buffer Eva Rachel Retuya <eraretuya@gmail.com> - 2017-05-02 14:30 +0200
  [PATCH v2 1/4] dt-bindings: iio: accel: adxl345: Add optional interrupt-names support Eva Rachel Retuya <eraretuya@gmail.com> - 2017-04-29 10:00 +0200
  [PATCH v2 3/4] iio: accel: adxl345: Setup DATA_READY trigger Eva Rachel Retuya <eraretuya@gmail.com> - 2017-04-29 10:00 +0200
    Re: [PATCH v2 3/4] iio: accel: adxl345: Setup DATA_READY trigger Jonathan Cameron <jic23@kernel.org> - 2017-05-01 02:40 +0200
      Re: [PATCH v2 3/4] iio: accel: adxl345: Setup DATA_READY trigger Rob Herring <robh+dt@kernel.org> - 2017-05-02 05:10 +0200
        Re: [PATCH v2 3/4] iio: accel: adxl345: Setup DATA_READY trigger Jonathan Cameron <jic23@kernel.org> - 2017-05-02 18:00 +0200
          Re: [PATCH v2 3/4] iio: accel: adxl345: Setup DATA_READY trigger Eva Rachel Retuya <eraretuya@gmail.com> - 2017-05-10 16:40 +0200
      Re: [PATCH v2 3/4] iio: accel: adxl345: Setup DATA_READY trigger Eva Rachel Retuya <eraretuya@gmail.com> - 2017-05-02 14:00 +0200
    Re: [PATCH v2 3/4] iio: accel: adxl345: Setup DATA_READY trigger Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-05-01 14:00 +0200
      Re: [PATCH v2 3/4] iio: accel: adxl345: Setup DATA_READY trigger Eva Rachel Retuya <eraretuya@gmail.com> - 2017-05-02 14:20 +0200
        Re: [PATCH v2 3/4] iio: accel: adxl345: Setup DATA_READY trigger Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-05-02 23:10 +0200
          Re: [PATCH v2 3/4] iio: accel: adxl345: Setup DATA_READY trigger Eva Rachel Retuya <eraretuya@gmail.com> - 2017-05-10 15:30 +0200
        Re: [PATCH v2 3/4] iio: accel: adxl345: Setup DATA_READY trigger Jonathan Cameron <jic23@kernel.org> - 2017-05-05 20:30 +0200
          Re: [PATCH v2 3/4] iio: accel: adxl345: Setup DATA_READY trigger Eva Rachel Retuya <eraretuya@gmail.com> - 2017-05-10 15:40 +0200

csiph-web