* [PATCH] regulator: max77693: Skip register regulator if no platform initialization data
@ 2013-06-29 4:04 Axel Lin
2013-06-29 12:26 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2013-06-29 4:04 UTC (permalink / raw)
To: Mark Brown; +Cc: Jonghwa Lee, Myungjoo Ham, Liam Girdwood, linux-kernel
The code in max77693_pmic_dt_parse_rdata() does skip setting rdata if
!rmatch[i].init_data. So we may have some empty entries in rdata[].
We need to skip register regulator if no platform initialization data,
otherwise we may resiter regulator with invalid settings ( the empty entries
of rdata[]).
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/regulator/max77693.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/regulator/max77693.c b/drivers/regulator/max77693.c
index d45a4dd..6116a49 100644
--- a/drivers/regulator/max77693.c
+++ b/drivers/regulator/max77693.c
@@ -265,6 +265,9 @@ static int max77693_pmic_probe(struct platform_device *pdev)
for (i = 0; i < max77693_pmic->num_regulators; i++) {
int id = rdata[i].id;
+ if (!rdata[i].initdata)
+ continue;
+
config.init_data = rdata[i].initdata;
config.of_node = rdata[i].of_node;
--
1.8.1.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] regulator: max77693: Skip register regulator if no platform initialization data
2013-06-29 4:04 [PATCH] regulator: max77693: Skip register regulator if no platform initialization data Axel Lin
@ 2013-06-29 12:26 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2013-06-29 12:26 UTC (permalink / raw)
To: Axel Lin; +Cc: Jonghwa Lee, Myungjoo Ham, Liam Girdwood, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 526 bytes --]
On Sat, Jun 29, 2013 at 12:04:19PM +0800, Axel Lin wrote:
> The code in max77693_pmic_dt_parse_rdata() does skip setting rdata if
> !rmatch[i].init_data. So we may have some empty entries in rdata[].
> We need to skip register regulator if no platform initialization data,
> otherwise we may resiter regulator with invalid settings ( the empty entries
> of rdata[]).
It should be legal to have no init data, this should make the regulator
available read only (allowing the current settings to be read back but
nothing else).
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-06-29 12:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-29 4:04 [PATCH] regulator: max77693: Skip register regulator if no platform initialization data Axel Lin
2013-06-29 12:26 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox