Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Arthur Becker <arthur.becker@sentec.com>
Cc: Arthur Becker via B4 Relay
	<devnull+arthur.becker.sentec.com@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCH v3 1/2] iio: light: driver for Vishay VEML6040
Date: Mon, 3 Jun 2024 19:22:18 +0100	[thread overview]
Message-ID: <20240603192218.23ad1b99@jic23-huawei> (raw)
In-Reply-To: <ZR1P278MB111719C989666990EB0B4D5E81FF2@ZR1P278MB1117.CHEP278.PROD.OUTLOOK.COM>

On Mon, 3 Jun 2024 12:18:58 +0000
Arthur Becker <arthur.becker@sentec.com> wrote:

> From: Jonathan Cameron <jic23@kernel.org>
> Sent: 02 June 2024 15:22
> To: Arthur Becker via B4 Relay
> Cc: Arthur Becker; Lars-Peter Clausen; Rob Herring; Krzysztof Kozlowski; Conor Dooley; linux-kernel@vger.kernel.org; linux-iio@vger.kernel.org; devicetree@vger.kernel.org
> Subject: [EXTERNAL]Re: [PATCH v3 1/2] iio: light: driver for Vishay VEML6040
> 
> > Hi Arthur,
> > 
> > A few really trivial things inline. I'd have just tidied them up whilst
> > applying, but I think you are doing a v4 anyway to merge the bindings
> > so I'll leave the requested tweaks to you.
> > 
> > Jonathan  
> 
> Hi Jonathan,
> 
> Thanks for the feedback!
> Small question about that comment:
> 
> > > +
> > > +     ret = devm_regulator_get_enable(dev, "vdd");
> > > +     if (ret)
> > > +             return ret;
> > > +
> > > +     int init_config =  
> >
> > Generally we are still sticking to traditional C rules so keep the
> > local variable definition at the top of the file.
> > The only common exception is when cleanup.h functionality is involved and
> > we want to ensure ordering by moving the variable definitions into the code.  
> 
> Do you mean at the start of the function, or rather a #define at the top of the
> file after the masks and register definitions?
> The use of 'FIELD_PREP' discards the 'static const int' option to initialise the
> variable at the top of the file.

start of the function for the variable.
e.g.
int init_config;


stuff..

init_config = FIELD_PREP() where you have it

Thanks,

Jonathan

> 
> Kind regards,
> Arthur
> 
> >  
> > > +             FIELD_PREP(VEML6040_CONF_IT_MSK, VEML6040_CONF_IT_40_MS) |
> > > +             FIELD_PREP(VEML6040_CONF_AF_MSK, 0) |
> > > +             FIELD_PREP(VEML6040_CONF_SD_MSK, 0);
> > > +
> > > +     ret = regmap_write(regmap, VEML6040_CONF_REG, init_config);
> > > +     if (ret)
> > > +             return dev_err_probe(dev, ret,
> > > +                                  "Could not set initial config\n");
> > > +  
> 
> 


  reply	other threads:[~2024-06-03 18:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-27 15:12 [PATCH v3 0/2] Add driver for Vishay VEML6040 Arthur Becker via B4 Relay
2024-05-27 15:12 ` [PATCH v3 1/2] iio: light: " Arthur Becker via B4 Relay
2024-06-02 13:22   ` Jonathan Cameron
2024-06-03 12:18     ` Arthur Becker
2024-06-03 18:22       ` Jonathan Cameron [this message]
2024-05-27 15:12 ` [PATCH v3 2/2] dt-bindings: iio: light: add VEML6040 RGBW-LS bindings Arthur Becker via B4 Relay
2024-05-27 16:30   ` Conor Dooley
2024-05-28  7:15     ` [EXTERNAL]Re: " Arthur Becker
2024-05-27 16:31   ` Krzysztof Kozlowski
2024-05-28  7:23     ` [EXTERNAL]Re: " Arthur Becker
2024-05-28 10:05       ` Jonathan Cameron
2024-05-30  9:00         ` Arthur Becker
2024-05-28 14:39       ` Rob Herring
2024-05-30  9:00         ` Arthur Becker
2024-06-02 13:16       ` Jonathan Cameron
2024-06-03  8:23         ` Arthur Becker
2024-06-03  8:25           ` 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=20240603192218.23ad1b99@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=arthur.becker@sentec.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=devnull+arthur.becker.sentec.com@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox