lkml.org 
[lkml]   [2011]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRE: [PATCH 13/14] regulator: check name in initialization of max8925


>-----Original Message-----
>From: Mark Brown [mailto:broonie@opensource.wolfsonmicro.com]
>Sent: 2011年4月19日 12:04 AM
>To: Haojian Zhuang
>Cc: Haojian Zhuang; sameo@linux.intel.com; linux-kernel@vger.kernel.org;
>dmitry.torokhov@gmail.com; a.zummo@towertech.it; johnpol@2ka.mipt.ru;
>cbou@mail.ru; dwmw2@infradead.org; lrg@slimlogic.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.
\
 
 \ /
  Last update: 2011-04-19 04:49    [W:0.145 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site