All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Subhajit Ghosh <subhajit.ghosh@tweaklogic.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>,
	Matti Vaittinen <mazziesaccount@gmail.com>,
	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 v6 5/5] iio: light: Add support for APDS9306 Light Sensor
Date: Wed, 7 Feb 2024 16:53:19 +0200	[thread overview]
Message-ID: <ZcOZX8mWTozC2EAc@smile.fi.intel.com> (raw)
In-Reply-To: <43e01493-1f26-414b-b2eb-7fb959b9b542@tweaklogic.com>

On Wed, Feb 07, 2024 at 09:37:37PM +1030, Subhajit Ghosh wrote:

...

> > > +static_assert(ARRAY_SIZE(apds9306_repeat_rate_freq) ==
> > > +		APDS9306_NUM_REPEAT_RATES);
> > 
> > Just make that define to be inside [] in the respective array and drop this
> > static assert. The assertion might make sense to have different arrays to be
> > synchronized and when their maximums are different due to semantics (not your
> > case AFAICS).

...

> > > +static_assert(ARRAY_SIZE(apds9306_repeat_rate_period) ==
> > > +		APDS9306_NUM_REPEAT_RATES);
> > 
> > Ditto.

> I apologize for this. You pointed me out in an earlier review, I misunderstood
> it and used the macro in two static asserts! It will be fixed.

It might be used, but not must be, use your common sense!
In this case it's easier to have all defined properly from the beginning.

...

> > > +static int apds9306_runtime_power_on(struct device *dev)
> > > +{
> > > +	int ret;
> > > +
> > > +	ret = pm_runtime_resume_and_get(dev);
> > > +	if (ret < 0)
> > > +		dev_err_ratelimited(dev, "runtime resume failed: %d\n", ret);
> > > +
> > > +	return ret;
> > > +}
> > > +
> > > +static int apds9306_runtime_power_off(struct device *dev)
> > > +{
> > > +	pm_runtime_mark_last_busy(dev);
> > > +	pm_runtime_put_autosuspend(dev);
> > > +
> > > +	return 0;
> > > +}
> > 
> > Seems to me like useless wrappers. Why do you need that message?
> No specific need for that message, however the wrapper was suggested in a previous review:
> https://lore.kernel.org/all/ZTuuUl0PBklbVjb9@smile.fi.intel.com/

I see, what I meant in previous review is to split to separate helpers.
Now, when we see how it looks like and how many actual users, we may
go further and drop them.

> Do you still want me to use the pm functions directly from the calling functions?

It seems a good move forward.

> > Btw, it's used only twice, open coding saves the LoCs!
> Yes, it makes sense.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2024-02-07 14:53 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-06 13:00 [PATCH v6 0/5] Support for Avago APDS9306 Ambient Light Sensor Subhajit Ghosh
2024-02-06 13:00 ` [PATCH v6 1/5] dt-bindings: iio: light: Merge APDS9300 and APDS9960 schemas Subhajit Ghosh
2024-02-06 13:00 ` [PATCH v6 2/5] dt-bindings: iio: light: adps9300: Add property vdd-supply Subhajit Ghosh
2024-02-08  8:17   ` Krzysztof Kozlowski
2024-02-08 10:40     ` Subhajit Ghosh
2024-02-09  7:33       ` Krzysztof Kozlowski
2024-02-10 17:01         ` Jonathan Cameron
2024-02-06 13:00 ` [PATCH v6 3/5] dt-bindings: iio: light: adps9300: Update interrupt definitions Subhajit Ghosh
2024-02-08  8:18   ` Krzysztof Kozlowski
2024-02-08 10:53     ` Subhajit Ghosh
2024-02-10 17:02       ` Jonathan Cameron
2024-02-06 13:00 ` [PATCH v6 4/5] dt-bindings: iio: light: Avago APDS9306 Subhajit Ghosh
2024-02-08  8:18   ` Krzysztof Kozlowski
2024-02-08 10:51     ` Subhajit Ghosh
2024-02-08 18:52       ` Conor Dooley
2024-02-09  7:34       ` Krzysztof Kozlowski
2024-02-06 13:00 ` [PATCH v6 5/5] iio: light: Add support for APDS9306 Light Sensor Subhajit Ghosh
2024-02-06 13:42   ` Andy Shevchenko
2024-02-07 11:07     ` Subhajit Ghosh
2024-02-07 14:53       ` Andy Shevchenko [this message]
2024-02-06 14:47 ` [PATCH v6 0/5] Support for Avago APDS9306 Ambient " Conor Dooley
2024-02-07 10:39   ` 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=ZcOZX8mWTozC2EAc@smile.fi.intel.com \
    --to=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 \
    --cc=subhajit.ghosh@tweaklogic.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 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.