devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Beniamino Galvani <b.galvani@gmail.com>
To: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>
Cc: Wenyou Yang <wenyou.yang@atmel.com>,
	Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Heiko Stuebner <heiko@sntech.de>, Axel Lin <axel.lin@ingics.com>,
	devicetree@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Beniamino Galvani <b.galvani@gmail.com>
Subject: [PATCH v2 1/4] regulator: act8865: set correct number of regulators in pdata
Date: Sat,  5 Jul 2014 15:20:53 +0200	[thread overview]
Message-ID: <1404566456-9121-2-git-send-email-b.galvani@gmail.com> (raw)
In-Reply-To: <1404566456-9121-1-git-send-email-b.galvani@gmail.com>

act8865_pdata_from_dt() populates the array pdata->regulators with all
the regulators and then assigns the field init_data only for the ones
actually found in the DT.

The patch changes the value assigned to pdata->num_regulators to match
the size of the array.

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Tested-by: Wenyou Yang <wenyou.yang@atmel.com>
---
 drivers/regulator/act8865-regulator.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/act8865-regulator.c b/drivers/regulator/act8865-regulator.c
index f07be36..52d1b6c 100644
--- a/drivers/regulator/act8865-regulator.c
+++ b/drivers/regulator/act8865-regulator.c
@@ -230,7 +230,7 @@ static int act8865_pdata_from_dt(struct device *dev,
 	if (!pdata->regulators)
 		return -ENOMEM;
 
-	pdata->num_regulators = matched;
+	pdata->num_regulators = ARRAY_SIZE(act8865_matches);
 	regulator = pdata->regulators;
 
 	for (i = 0; i < ARRAY_SIZE(act8865_matches); i++) {
-- 
1.7.10.4

  reply	other threads:[~2014-07-05 13:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-05 13:20 [PATCH v2 0/4] regulator: act8865: add support for act8846 Beniamino Galvani
2014-07-05 13:20 ` Beniamino Galvani [this message]
     [not found]   ` <1404566456-9121-2-git-send-email-b.galvani-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-07-05 15:08     ` [PATCH v2 1/4] regulator: act8865: set correct number of regulators in pdata Axel Lin
2014-07-05 15:31       ` Axel Lin
2014-07-05 13:20 ` [PATCH v2 2/4] regulator: act8865: prepare support for other act88xx devices Beniamino Galvani
2014-07-05 15:41   ` Axel Lin
2014-07-05 17:48     ` Beniamino Galvani
2014-07-05 13:20 ` [PATCH v2 3/4] regulator: act8865: add support for act8846 Beniamino Galvani
2014-07-05 13:20 ` [PATCH v2 4/4] regulator: act8865: add act8846 to DT binding documentation Beniamino Galvani

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=1404566456-9121-2-git-send-email-b.galvani@gmail.com \
    --to=b.galvani@gmail.com \
    --cc=axel.lin@ingics.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=heiko@sntech.de \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=lgirdwood@gmail.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=wenyou.yang@atmel.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).