Devicetree
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: "Erikas Bitovtas" <xerikasxx@gmail.com>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Peter Meerwald" <pmeerw@pmeerw.net>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	~postmarketos/upstreaming@lists.sr.ht,
	phone-devel@vger.kernel.org,
	"Raymond Hackley" <raymondhackley@protonmail.com>
Subject: Re: [PATCH 2/2] iio: light: vcnl4000: add regulator support
Date: Sun, 15 Mar 2026 18:16:10 +0000	[thread overview]
Message-ID: <20260315181610.4a99e985@jic23-huawei> (raw)
In-Reply-To: <abFejMb3uLbg4fiu@ashevche-desk.local>

On Wed, 11 Mar 2026 14:22:36 +0200
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:

> On Wed, Mar 11, 2026 at 01:38:03PM +0200, Erikas Bitovtas wrote:
> > Add supply, I2C and cathode voltage regulators to the sensor and enable
> > them. This keeps the sensor powered on even after its only supply shared
> > by another device shuts down.  
> 
> > Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
> > Reported-by: Raymond Hackley <raymondhackley@protonmail.com>  
> 
> Where was it reported? Do you need Closes tag?
> 
> ...
> 
> > +#include "linux/array_size.h"
> > +#include "linux/regulator/consumer.h"  
> 
> Double quotes, huh?!
> 
> >  #include <linux/bitfield.h>
> >  #include <linux/module.h>
> >  #include <linux/i2c.h>  
> 
> Also, please keep the list ordered.
> 
> ...
> 
> >  	mutex_init(&data->vcnl4000_lock);
> > +	ret = devm_regulator_bulk_get_enable(&client->dev,
> > +				      ARRAY_SIZE(regulator_names),
> > +				      regulator_names);
> > +	if (ret < 0)
> > +		return ret;  
> 
> You can't add devm_ after non-devm calls.

This one happens to be fine because there is no cleanup of the
mutex_init(), so it is sort of not mixing devm and non devm.
That is kind of a historical thing where I for one wasn't convinced
it was worth the annoyance of mutex_destroy() until the devm
easy way of doing it came along.

Now, as the code is being touched anyway, I would
like that moved to
ret = devm_mutex_init();
if (ret)
	return ret;
as a precursor patch both as it makes it obvious we are still devm and
to get the advantage when lock debugging is turned on.

Thanks

Jonathan

> Also it would help you to have
> 
> 	struct device *dev = &client->dev;
> 
> at the top of the function.
> 
> ...
> 
> With the above being said, I expect a series out of two patches at least.
> 


      parent reply	other threads:[~2026-03-15 18:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-11 11:38 [PATCH 0/2] iio: light: vcnl4000: add regulator support Erikas Bitovtas
2026-03-11 11:38 ` [PATCH 1/2] dt-bindings: iio: light: vcnl4000: add regulators Erikas Bitovtas
2026-03-11 11:38 ` [PATCH 2/2] iio: light: vcnl4000: add regulator support Erikas Bitovtas
2026-03-11 12:22   ` Andy Shevchenko
2026-03-11 12:40     ` Erikas Bitovtas
2026-03-11 15:54       ` Andy Shevchenko
2026-03-15 18:16     ` Jonathan Cameron [this message]

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=20260315181610.4a99e985@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=phone-devel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=raymondhackley@protonmail.com \
    --cc=robh@kernel.org \
    --cc=xerikasxx@gmail.com \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /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