public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Leonard Crestez <leonard.crestez@nxp.com>
To: Pierre-Hugues Husson <phh@phh.me>,
	Mark Brown <broonie@kernel.org>,
	"Lee Jones" <lee.jones@linaro.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RESEND] regulator: rn5t618: add RC5T619 PMIC support
Date: Fri, 13 Oct 2017 19:29:41 +0300	[thread overview]
Message-ID: <1507912181.10770.15.camel@nxp.com> (raw)
In-Reply-To: <20170827135831.15860-1-phh@phh.me>

On Sun, 2017-08-27 at 15:58 +0200, Pierre-Hugues Husson wrote:
> Extend the driver to support Ricoh RC5T619.
> Support the additional regulators and slightly different voltage ranges.
> 
> @@ -101,10 +131,7 @@ static int rn5t618_regulator_probe(struct platform_device *pdev)
>  	config.dev = pdev->dev.parent;
>  	config.regmap = rn5t618->regmap;
>  
> -	for (i = 0; i < RN5T618_REG_NUM; i++) {
> -		if (!regulators[i].name)
> -			continue;
> -
> +	for (i = 0; i < num_regulators; i++) {
>  		rdev = devm_regulator_register(&pdev->dev,
>  					       ®ulators[i],
>  					       &config);

This is wrong. The rn5t*_regulators arrays are indexed by RN5T618_*
constants and can have gaps. If you remove the check for
regulators[i].name then older models get errors like this:
	
rn5t618-regulator rn5t618-regulator: failed to register (null) regulator
rn5t618-regulator: probe of rn5t618-regulator failed with error -22

Either the check needs to be kep or otherwise regulator_desc arrays
should be modified. Indexing by RN5T618_* does not appear to be used so
maybe just use a flat array? That would also save a few bytes of
memory.

I know it's a late comment and the patch was already accepted, I just
noticed that rn5t567 fails to probe while working on something else.

--
Regards,
Leonard

      parent reply	other threads:[~2017-10-13 16:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-27 13:58 [PATCH RESEND] regulator: rn5t618: add RC5T619 PMIC support Pierre-Hugues Husson
2017-09-04  8:53 ` Lee Jones
2017-10-13 16:29 ` Leonard Crestez [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=1507912181.10770.15.camel@nxp.com \
    --to=leonard.crestez@nxp.com \
    --cc=broonie@kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=phh@phh.me \
    /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