devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Subhajit Ghosh <subhajit.ghosh@tweaklogic.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Matti Vaittinen <mazziesaccount@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>, Marek Vasut <marex@denx.de>,
	Anshul Dalal <anshulusr@gmail.com>,
	Javier Carrasco <javier.carrasco.cruz@gmail.com>,
	Matt Ranostay <matt@ranostay.sg>,
	Stefan Windfeldt-Prytz <stefan.windfeldt-prytz@axis.com>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8 5/5] iio: light: Add support for APDS9306 Light Sensor
Date: Thu, 29 Feb 2024 23:04:04 +1030	[thread overview]
Message-ID: <45386f39-a034-4d70-a6d4-8804c27aadce@tweaklogic.com> (raw)
In-Reply-To: <Zd9tApJClX7Frq20@smile.fi.intel.com>

On 29/2/24 03:57, Andy Shevchenko wrote:
> On Wed, Feb 28, 2024 at 03:08:56PM +0200, Matti Vaittinen wrote:
>> On 2/28/24 14:24, Subhajit Ghosh wrote:
> 
> ...
> 
>>> +	ret = iio_gts_find_new_gain_by_old_gain_time(&data->gts, gain_old,
>>> +						     intg_old, val2, &gain_new);
>>
>> You don't use the 'ret' here, so maybe for the clarity, not assign it.
>> Or, maybe you wan't to try to squeeze out few cycles for succesful case and
>> check the ret for '0' - in which case you should be able to omit the check
>> right below as well as the call to iio_find_closest_gain_low(). OTOH, this
>> is likely not a "hot path" so I don't care too much about the extra call if
>> you think code is clearer this way.
>>
>>> +	if (gain_new < 0) {
>>> +		dev_err_ratelimited(dev, "Unsupported gain with time\n");
>>> +		return gain_new;
>>> +	}
> 
> What is the difference between negative response from the function itself and
> similar in gain_new?
> 
-ve response form the function is an error condition.
-ve value in gain_new means - no valid gains could be computed.
In case of error conditions from the function, the gain_new is also set to -1.
My use case is valid hardware gain so I went for checking only gain_new.
Matti will be the best person to answer on this.

Regards,
Subhajit Ghosh

  reply	other threads:[~2024-02-29 12:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-28 12:24 [PATCH v8 0/5] Support for Avago APDS9306 Ambient Light Sensor Subhajit Ghosh
2024-02-28 12:24 ` [PATCH v8 1/5] dt-bindings: iio: light: Merge APDS9300 and APDS9960 schemas Subhajit Ghosh
2024-02-28 12:24 ` [PATCH v8 2/5] dt-bindings: iio: light: adps9300: Add missing vdd-supply Subhajit Ghosh
2024-02-28 12:24 ` [PATCH v8 3/5] dt-bindings: iio: light: adps9300: Update interrupt definitions Subhajit Ghosh
2024-02-28 12:24 ` [PATCH v8 4/5] dt-bindings: iio: light: Avago APDS9306 Subhajit Ghosh
2024-02-28 12:24 ` [PATCH v8 5/5] iio: light: Add support for APDS9306 Light Sensor Subhajit Ghosh
2024-02-28 13:08   ` Matti Vaittinen
2024-02-28 17:27     ` Andy Shevchenko
2024-02-29 12:34       ` Subhajit Ghosh [this message]
2024-02-29 12:58         ` Matti Vaittinen
2024-02-29 13:42           ` Andy Shevchenko
2024-02-29 15:35             ` Matti Vaittinen
2024-03-03 14:55               ` Jonathan Cameron
2024-02-29 11:51     ` Subhajit Ghosh
2024-03-03 15:14   ` Jonathan Cameron
2024-03-04 12:48     ` Subhajit Ghosh

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=45386f39-a034-4d70-a6d4-8804c27aadce@tweaklogic.com \
    --to=subhajit.ghosh@tweaklogic.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=anshulusr@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=javier.carrasco.cruz@gmail.com \
    --cc=jic23@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=matt@ranostay.sg \
    --cc=mazziesaccount@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=stefan.windfeldt-prytz@axis.com \
    /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;
as well as URLs for NNTP newsgroup(s).