All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Nosthoff <committed@heine.so>
To: linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio: ad7793: implement IIO_CHAN_INFO_SAMP_FREQ
Date: Thu, 08 Mar 2018 10:33:02 +0100	[thread overview]
Message-ID: <438ef108f17bcb2ca7ac2e284afd9489@heine.so> (raw)
In-Reply-To: <e4800a5aded78249f54837798efa0e3b@heine.so>

On 2018-03-07 19:02, Michael Nosthoff wrote:
> On 2018-03-07 17:43, Lars-Peter Clausen wrote:
>> On 03/07/2018 05:17 PM, Michael Nosthoff wrote:
>> [...]
>>> +    case IIO_CHAN_INFO_SAMP_FREQ:
>>> +        if (!val) {
>>> +            ret = -EINVAL;
>>> +            break;
>>> +        }
>>> +
>>> +        for (i = 0; i < 16; i++)
>>> +            if (val == st->chip_info->sample_freq_avail[i])
>>> +                break;
>>> +
>>> +        if (i == 16) {
>>> +            ret = -EINVAL;
>>> +            break;
>>> +        }
>>> +
>>> +        st->mode &= ~AD7793_MODE_RATE(-1);
>>> +        st->mode |= AD7793_MODE_RATE(i);
>>> +        ad_sd_write_reg(&st->sd, AD7793_REG_MODE, sizeof(st->mode), 
>>> st->mode);
>>> +        ret = 0;
>> 
>> I don't think the ret = 0 is needed here, it should already be 0. But 
>> of
>> course it does not hurt either.
> 
> My fault. I tested against 4.14 which doesn't have the
> "use iio helper function to guarantee direct mode" commit which 
> initializes
> ret. Which produces a compiler warning.
> So if I remove it a backport would require that commit to be pulled 
> first.

I just noticed I mixed something up, the mentioned patch is already 
applied in 4.14.
I'll remove the line and resubmit the patch.



  reply	other threads:[~2018-03-08  9:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-07 16:17 [PATCH] iio: ad7793: implement IIO_CHAN_INFO_SAMP_FREQ Michael Nosthoff
2018-03-07 16:43 ` Lars-Peter Clausen
2018-03-07 18:02   ` Michael Nosthoff
2018-03-08  9:33     ` Michael Nosthoff [this message]
2018-03-09 15:13 Michael Nosthoff
2018-03-12  9:10 ` Michael Nosthoff
2018-03-12  9:18   ` Ardelean, Alexandru
2018-03-17 20:36     ` 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=438ef108f17bcb2ca7ac2e284afd9489@heine.so \
    --to=committed@heine.so \
    --cc=linux-iio@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.