[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <25B60CDC2F704E4E9D88FFD52780CB4C05CF05B424@SC-VEXCH1.marvell.com>
Date: Mon, 18 Apr 2011 19:42:09 -0700
From: Haojian Zhuang <hzhuang1@...vell.com>
To: Mark Brown <broonie@...nsource.wolfsonmicro.com>,
Haojian Zhuang <haojian.zhuang@...il.com>
CC: "sameo@...ux.intel.com" <sameo@...ux.intel.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"dmitry.torokhov@...il.com" <dmitry.torokhov@...il.com>,
"a.zummo@...ertech.it" <a.zummo@...ertech.it>,
"johnpol@....mipt.ru" <johnpol@....mipt.ru>,
"cbou@...l.ru" <cbou@...l.ru>,
"dwmw2@...radead.org" <dwmw2@...radead.org>,
"lrg@...mlogic.co.uk" <lrg@...mlogic.co.uk>
Subject: RE: [PATCH 13/14] regulator: check name in initialization of max8925
>-----Original Message-----
>From: Mark Brown [mailto:broonie@...nsource.wolfsonmicro.com]
>Sent: 2011年4月19日 12:04 AM
>To: Haojian Zhuang
>Cc: Haojian Zhuang; sameo@...ux.intel.com; linux-kernel@...r.kernel.org;
>dmitry.torokhov@...il.com; a.zummo@...ertech.it; johnpol@....mipt.ru;
>cbou@...l.ru; dwmw2@...radead.org; lrg@...mlogic.co.uk
>Subject: Re: [PATCH 13/14] regulator: check name in initialization of
>max8925
>
>On Mon, Apr 18, 2011 at 11:33:34PM +0800, Haojian Zhuang wrote:
>
>> So I want to avoid to use the index and check regulator[] one by one.
>> I use a pointer to link
>> all regulator data together. I just need to check whether the
>> regulator pointer is valid or not.
>
>Why? I don't understand what the goal of this change is.
Original implementation:
Max8925_core.c:
If ((pdata == NULL) || (pdata->regulator[0] == NULL))
Return -EINVAL;
Machine driver:
Platform data:
.regulator[0] = xxx
.regulator[1] = xxx
The index of regulator array is id of buck and ldo.
There's issue in max8925_core.c since we can't assume regulator[0] always declared in machine driver.
Current implementation:
Max8925_core.c:
If ((pdata == NULL) || (pdata->regulator == NULL))
Return -EINVAL;
Machine driver:
Platform data:
Use two parameters: num_regulators and regulator pointer. The index of new regulator array isn't id of buck and ldo any more.
Powered by blists - more mailing lists